### Question:
GyroErrorStrategy extends DefaultErrorStrategy { @Override protected void reportNoViableAlternative(Parser recognizer, NoViableAltException error) { recognizer.notifyErrorListeners(error.getOffendingToken(), "Invalid input", error); }   static final GyroErrorStrategy INSTANCE; }### Answer:
@Test void reportNoViableAlternative() { NoViableAltException error = mock(NoViableAltException.class); when(error.getOffendingToken()).thenReturn(token); strategy.reportNoViableAlternative(recognizer, error); verify(recognizer).notifyErrorListeners(token, "Invalid input", error); }