### Question:
StringIterator { public int getIndex() { return index; } StringIterator(String string); String getString(); String getRemaining(); int getIndex(); boolean atEnd(); char curr(); char read(); void advance(); boolean match(char value); boolean match(MatchPattern pattern); boolean match(CharPredicate charPredicate); boolean match(char value, StringBuilder buffer); boolean match(String substring); boolean matchDigits(StringBuilder buffer); boolean matchCharRange(int minChar, int maxChar, StringBuilder buffer); boolean matchDigit(StringBuilder buffer); void skipAheadPast(String substr); boolean skipAheadPastIfExists(String substr); void checkAndAdvance(char c); boolean isLineBreak(); boolean isWhitespace(); boolean isDigit(); boolean isAsciiLetter(); boolean isWhitespaceOnSameLine(); void advancePastWhitespace(); void advancePastWhitespaceOnSameLine(); String readWhitespaceDelimitedToken(); String readWhitespaceDelimitedTokenOnSameLine();  }### Answer:
@Test public void testGetIndex() { StringIterator sut = new StringIterator("Test 2string"); assertEquals(0, sut.getIndex()); sut.advance(); sut.advance(); assertEquals(2, sut.getIndex()); }