AscendingBitSetIndexToIndexMultiMap implements IndexToIndexMultiMap { @Override public boolean getTo( @NotNull final BitSet dest, final int toExclusive) { assert 0 < toExclusive && toExclusive <= keysCount; if (toExclusive == keysCount) { return dest.or(getNonNull(dest.getSize())); } return dest.or(elements, toExclusive * bitSetSizeInBytes, bitSetSizeInLongs); } private  AscendingBitSetIndexToIndexMultiMap(
            final int keysCount,
            @NotNull
            final Buffer elements,
            final int bitSetSizeInLongs); @NotNull static AscendingBitSetIndexToIndexMultiMap from(
            @NotNull
            final Buffer buf); @Override boolean get(
            @NotNull
            final BitSet dest,
            final int key); @Override boolean getFrom(
            @NotNull
            final BitSet dest,
            final int fromInclusive); @Override boolean getTo(
            @NotNull
            final BitSet dest,
            final int toExclusive); @Override boolean getBetween(
            @NotNull
            final BitSet dest,
            final int fromInclusive,
            final int toExclusive); @Override int getKeysCount(); @Override String toString(); @NotNull @Override Iterator<IntToIntArray> ascending(
            @NotNull
            final BitSet valueFilter); @NotNull @Override Iterator<IntToIntArray> descending(
            @NotNull
            final BitSet valueFilter);  }
@Test public void getTo() { AscendingBitSetIndexToIndexMultiMap index = build(); final BitSet dest = LongArrayBitSet.zero(DOCS); final BitSet expected = LongArrayBitSet.zero(DOCS); expected.set(0); expected.set(1); expected.set(2); expected.set(3); assertTrue("Destination non-zero", index.getTo(dest, 2)); dest.xor(expected); assertTrue("Documents (0, 1, 2, 3) are set", dest.cardinality() == 0); }