code: public static final long fromBitSet(final BitSet bits) {
      long value = 0L;
      for (int i = 0; i < bits.size(); i++) {
        value += bits.get(i) ? (1L << i) : 0L;
      }
      return value;
    }
docs: Converts the {@link BitSet} {@code bits} into a long value.
  <p>
  This is the reverse operation from {@link #toBitSet(int, long)}.