VariableLengthByteArrayIndexedList implements ByteArrayIndexedList { @Override public String toString() { return "VariableLengthByteArrayIndexedList{" + "elementsCount=" + elements.size() + '}'; } VariableLengthByteArrayIndexedList(
            @NotNull
            final Collection<UnsignedByteArray> elements); @Override long getSizeInBytes(); @Override void writeTo(
            @NotNull
            final OutputStream os); @Override String toString();  }
@Test public void string() { final Collection<UnsignedByteArray> elements = new LinkedList<>(); final int size = 10; for (int i = 0; i < size; i++) elements.add(from(i)); final ByteArrayIndexedList set = new VariableLengthByteArrayIndexedList(elements); final String text = set.toString(); assertTrue(text.contains(Integer.toString(size))); }