UriTokenizer { public void saveState() { savedStartIndex = startIndex; savedIndex = index; } UriTokenizer(final String parseString); void saveState(); void returnToSavedState(); String getText(); boolean next(final TokenKind allowedTokenKind);  }
@Test public void saveState() { UriTokenizer tokenizer = new UriTokenizer("a*"); assertTrue(tokenizer.next(TokenKind.ODataIdentifier)); tokenizer.saveState(); assertTrue(tokenizer.next(TokenKind.STAR)); assertTrue(tokenizer.next(TokenKind.EOF)); tokenizer.returnToSavedState(); assertTrue(tokenizer.next(TokenKind.STAR)); assertTrue(tokenizer.next(TokenKind.EOF)); }