TrieByteArraySortedSet implements ByteArraySortedSet { @Override public int indexOf(@NotNull UnsignedByteArray e) throws NoSuchElementException { return root.valueOf(new BufferIterator(e.toByteBuffer())); } TrieByteArraySortedSet(SortedSet<UnsignedByteArray> keys); @Override int indexOf(@NotNull UnsignedByteArray e); @Override long getSizeInBytes(); @Override void writeTo(@NotNull OutputStream os);  }
@Test public void indexOf() { assertEquals(3, tbs.indexOf(UnsignedByteArrays.from("assignment"))); }
@Test(expected = NoSuchElementException.class) public void invalidIndexOf() { tbs.indexOf(UnsignedByteArrays.from("z")); }
@Test(expected = NoSuchElementException.class) public void invalidIndexOf2() { tbs.indexOf(UnsignedByteArrays.from("assignm")); }
@Test(expected = NoSuchElementException.class) public void invalidIndexOf3() { tbs.indexOf(UnsignedByteArrays.from("ca")); }