ParseState { String consume() { if (la() == null) { throw new RuntimeException("parse error"); } return this.args[this.cur++]; } ParseState(String... args);   }
@Test(expected = RuntimeException.class) public void testTooMuchConsume() { ParseState state = new ParseState("foo"); assertThat( state.consume() ).isEqualTo( "foo" ); state.consume(); }