Maybe it should be public and go into the util package?
This set implementation is quite limited, for instance it does not support modifications after creation. I am not against making it reusable but I'd like to wait for other use-cases for this class first, maybe there won't be any.
Did you consider simply ripping off the one from HPPC?
That is another idea indeed. The thing that made me decide against it is that it would pull close to 1k lines of code as well as several classes from hppc like AbstractLongCollection, LongSet, etc. I think that would be a good idea if we needed a more complete set implementation on top of longs, which doesn't seem to be the case today.
Can you please remind me on why PrefixCodedTerms exists instead of an FST?
PrefixCodedTerms should be more compact (this might depend on the efficiency of suffix compression by the FST for the given data) and cheaper to build. On the other hand, the FST has more features, like the ability to do lookups.