TrieByteArraySortedSet implements ByteArraySortedSet { @Override public int indexOfGreaterThan(@NotNull Buffer element, boolean orEquals, int upToIndexInclusive) { if (size() > 0) { int result = indexOfGreaterThan(new BufferIterator(element), orEquals); return result == keysCount ? NOT_FOUND : Math.min(result, upToIndexInclusive); } return NOT_FOUND; } private  TrieByteArraySortedSet(@NotNull Buffer nodes,
                                   int keysCount); static TrieByteArraySortedSet from(
            @NotNull final Buffer buffer); @Override int size(); @NotNull @Override Buffer get(int i); @Override long getLongUnsafe(int i); @Override int getIntUnsafe(int i); @Override short getShortUnsafe(int i); @Override char getCharUnsafe(int i); @Override byte getByteUnsafe(int i); @Override int indexOf(@NotNull Buffer element); @Override int indexOfGreaterThan(@NotNull Buffer element, boolean orEquals, int upToIndexInclusive); @Override int indexOfLessThan(@NotNull Buffer element, boolean orEquals, int fromIndexInclusive);  }
@Test public void indexOfGreaterThan() { for (String q : queries) { assertEquals( String.format("for query <%s>", q), variableSet.indexOfGreaterThan(query(q), false, lastIndex), trieSet.indexOfGreaterThan(query(q), false, lastIndex) ); } }
@Test public void indexOfGreaterThanOrEquals() { for (String q : queries) { assertEquals( String.format("for query <%s>", q), variableSet.indexOfGreaterThan(query(q), true, lastIndex), trieSet.indexOfGreaterThan(query(q), true, lastIndex) ); } }
@Test public void indexOfGreaterThanEmpty() { for (String q : queries) { assertEquals( String.format("for query <%s>", q), -1, emptyTrieSet.indexOfGreaterThan(query(q), true, lastIndex) ); } }