EDITokenizer extends AbstractTokenizer { @Override public String toString() { String result = "tokenizer state:"; result += " segmentCount=" + segmentCount; result += " charCount=" + charCount; result += " segTokenCount=" + segTokenCount; result += " segCharCount=" + segCharCount; result += " currentToken=" + currentToken; result += " buffer.limit=" + ((Buffer) charBuffer).limit(); result += " buffer.position=" + charBuffer.position(); return result; } EDITokenizer(Reader source);  EDITokenizer(Reader source, char[] preRead); @Override String toString(); void getChar(); char[] getBuffered(); char[] lookahead(int n); static final int BUFFER_SIZE; }
@Test public void testToString() throws Exception { tokenizer = new EDITokenizer(new StringReader( "abc")); tokenizer.nextToken(); assertEquals("tokenizer state: segmentCount=1 charCount=4 segTokenCount=1 segCharCount=4 currentToken=Token type=SEGMENT_START value=abc index=0 segment=abc buffer.limit=0 buffer.position=0", tokenizer.toString()); }