SingleIterator implements SizedIterator<OBJECT> { @Pure @Override public int rest() { if (this.object == null) { return 0; } return 1; } SingleIterator(OBJECT obj); @Pure @Override boolean hasNext(); @Override OBJECT next(); @Pure @Override int index(); @Pure @Override int totalSize(); @Pure @Override int rest();  }
@Test public void rest() { assertEquals(1, this.iterator.rest()); this.iterator.next(); assertEquals(0, this.iterator.rest()); }