ErrorHandlerImpl implements ErrorHandler { @Override public void warning(SAXParseException exception) throws SAXException { result.addError(exception); } ErrorHandlerImpl(XmlValidationResult result); @Override void warning(SAXParseException exception); @Override void error(SAXParseException exception); @Override void fatalError(SAXParseException exception); List<SAXParseException> getExceptions();  }
@Test public void testWarning() throws SAXException { SAXParseException eMock = mock(SAXParseException.class); sut.warning(eMock); verify(resultMock, times(1)).addError(eMock); }