EmptyParseError implements ParseErrorDetails { EmptyParseError(int index, String encountered) { this.index = index; this.encountered = encountered; } EmptyParseError(int index, String encountered); @Override final String getEncountered(); @Override List<String> getExpected(); @Override String getFailureMessage(); @Override final int getIndex(); @Override String getUnexpected();  }
@Test public void testEmptyParseError() { EmptyParseError error = new EmptyParseError(1, "foo"); assertEquals(1, error.getIndex()); assertEquals("foo", error.getEncountered()); assertNull(error.getUnexpected()); assertNull(error.getFailureMessage()); assertEquals(0, error.getExpected().size()); }