CompactList implements Iterable<MutableDirectBuffer>, CloseableSilently { @Override public CompactListIterator iterator() { iterator.reset(); return iterator; } CompactList(
      final int elementMaxLength, final int capacity, final BufferAllocator bufferAllocator);  CompactList(
      final AllocatedBuffer allocatedBuffer, final int elementMaxLength, final int capacity);  CompactList(final UnsafeBuffer listBuffer); void add(final DirectBuffer srcBuffer); void add(final DirectBuffer srcBuffer, final int offset, final int length); void add(final DirectBuffer srcBuffer, final int offset, final int length, final int idx); void set(final int idx, final DirectBuffer srcBuffer); void set(final int idx, final DirectBuffer srcBuffer, final int offset, final int length); void remove(final int idx); int size(); int sizeVolatile(); int capacity(); int maxElementDataLength(); int get(final int idx, final MutableDirectBuffer dstBuffer, final int offset); int wrap(final int idx, final MutableDirectBuffer dstBuffer); int getEncodedSize(); DirectBuffer getRawBuffer(); int find(final DirectBuffer key, final Comparator<DirectBuffer> c); int copyInto(final MutableDirectBuffer dstBuffer, final int offset); void clear(); @Override CompactListIterator iterator(); InputStream toInputStream(); @Override void close();  }
@Test public void shouldIterate() { addValues(); final CompactListIterator iterator = list.iterator(); assertThat(iterator.next().getInt(0)).isEqualTo(0); assertThat(iterator.next().getInt(0)).isEqualTo(1); assertThat(iterator.next().getInt(0)).isEqualTo(2); assertThat(iterator.next().getInt(0)).isEqualTo(3); assertThat(iterator.next().getInt(0)).isEqualTo(4); assertThat(iterator.next().getInt(0)).isEqualTo(5); assertThat(iterator.next().getInt(0)).isEqualTo(6); assertThat(iterator.next().getInt(0)).isEqualTo(7); assertThat(iterator.next().getInt(0)).isEqualTo(8); assertThat(iterator.next().getInt(0)).isEqualTo(9); }
@Test public void shouldExceptionNoSuchElement() { final CompactListIterator iterator = list.iterator(); expectedExceptionRule.expect(NoSuchElementException.class); iterator.next(); }
@Test public void shouldNotHaveNextElement() { final CompactListIterator iterator = list.iterator(); assertThat(iterator.hasNext()).isFalse(); }
@Test public void shouldHaveNextElement() { addValues(); final CompactListIterator iterator = list.iterator(); assertThat(iterator.hasNext()).isTrue(); }
@Test public void shouldReturnPosition() { addValues(); final CompactListIterator iterator = list.iterator(); iterator.next(); assertThat(iterator.position()).isEqualTo(0); }
@Test public void shouldResetPosition() { addValues(); final CompactListIterator iterator = list.iterator(); iterator.next(); iterator.reset(); assertThat(iterator.position()).isEqualTo(-1); }