public static List < Long > indexes ( final MutableBitSet bits ) { List < Long > indexes = new ArrayList <> ( ( int ) bits . cardinality ( ) ) ; for ( long i = bits . nextSetBit ( 0 ) ; i >= 0 ; i = bits . nextSetBit ( i + 1 ) ) { indexes . add ( i ) ; } return indexes ; }
Get the indexes of a bitset .