code: public static final BitSet toBitSet(final int size, final long value) {
      BitSet bits = new BitSet(size);
      int idx = 0;
      long tmp = value;
      while (tmp != 0L) {
        if (tmp % 2L != 0L) {
          bits.set(idx);
        }
        ++idx;
        tmp = tmp >>> 1;
      }
      return bits;
    }
docs: Converts {@code value} into a {@link BitSet} of size {@code size}.