@Test
public void expectThrowsWhenNotMatching() {

    RuntimeException e = Assertions.assertThrows(RuntimeException.class, () -> {
        new SimpleParser("foo").expect('!');
    });
    assertThat(e.getMessage(), equalTo("Syntax error at line 1 column 1: Expected: '!', but found 'f'"));
}