8283848586878889909192
TokenIterator tokIt = str.iterator(); while(tokIt.hasNext()){ tokIt.next(); } assertFalse(tokIt.hasNext()); assertNull(tokIt.peek()); } @Test public final void testIteratorPeek() {
90919293949596979899100
@Test public final void testIteratorPeek() { TokenStream str = tokenizer.tokenize(test1); TokenIterator tokIt = str.iterator(); assertEquals("vara",tokIt.peek().getString() ); assertEquals("vara",tokIt.next().getString() ); }