### Question:
CharacterReader { String consumeToEnd() { String data = input.substring(pos, input.length()); pos = input.length(); return data; } CharacterReader(String input); @Override String toString();  }### Answer:
@Test public void consumeToEnd() { String in = "one two three"; CharacterReader r = new CharacterReader(in); String toEnd = r.consumeToEnd(); assertEquals(in, toEnd); assertTrue(r.isEmpty()); }