BitSetIndexToIndexMultiMap implements IndexToIndexMultiMap { @NotNull @Override public Iterator<IntToIntArray> descending( @NotNull final BitSet valueFilter) { final ArrayBitSet bs = LongArrayBitSet.zero(valueFilter.getSize()); return IntStream.iterate(keysCount - 1, i -> i - 1) .mapToObj(i -> getIntToIntArray(valueFilter, bs, i)) .limit(keysCount) .iterator(); } private  BitSetIndexToIndexMultiMap(
            final int keysCount,
            @NotNull
            final Buffer elements,
            final int bitSetSizeInLongs); @NotNull static BitSetIndexToIndexMultiMap 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 descending() throws IOException { build().descending(LongArrayBitSet.one(DOCS)).forEachRemaining(itia -> { final int key = itia.getKey(); assertTrue(Arrays.stream(itia.getValues()).allMatch(v -> key == v / 2)); }); }