### Question:
GyroErrorStrategy extends DefaultErrorStrategy { @Override protected void reportUnwantedToken(Parser recognizer) { if (inErrorRecoveryMode(recognizer)) { return; } beginErrorCondition(recognizer); recognizer.notifyErrorListeners(recognizer.getCurrentToken(), "Extra input", null); }   static final GyroErrorStrategy INSTANCE; }### Answer:
@Test void reportUnwantedToken() { when(recognizer.getCurrentToken()).thenReturn(token); strategy.reportUnwantedToken(recognizer); assertThat(strategy.inErrorRecoveryMode(recognizer)).isTrue(); verify(recognizer).notifyErrorListeners(token, "Extra input", null); }
@Test void reportUnwantedTokenInRecovery() { doReturn(true).when(strategy).inErrorRecoveryMode(recognizer); strategy.reportUnwantedToken(recognizer); verifyNoMoreInteractions(recognizer); }