IdStack implements Iterable<String> { public int size() { return deque.size(); }  void push(String id, E item); E peek(); E pop(); boolean isEmpty(); int size(); String peekId(); void clear(); E get(final String id); boolean containsId(final String id); E remove(final String id); boolean isTop(final String id); @NonNull @Override Iterator<String> iterator(); Collection<E> values();  }
@Test public void size() throws Exception { assertThat(uut.size()).isEqualTo(0); uut.push("123", 123); assertThat(uut.size()).isEqualTo(1); }