code: public final static byte[] encode(long[] values) throws IOException {
      LongTermsSet termsSet = new LongTermsSet(values.length, new NoopCircuitBreaker("<term_set>"));
      for (int i = 0; i < values.length; i++) {
        termsSet.add(values[i]);
      }
      return termsSet.writeToBytes().bytes;
    }
docs: Encodes a list of longs into a serialised {@link LongTermsSet}.