XmlValidationResult { public void addError(SAXParseException exception) { this.exceptions.add(exception); } XmlValidationResult(); boolean isValid(); void addError(SAXParseException exception); List<SAXParseException> getExceptions();  }
@SuppressWarnings({ "unchecked", "rawtypes" }) @Test public void testAddError() { List listMock = mock(List.class); SAXParseException eMock = mock(SAXParseException.class); ReflectionTestUtils.setField(sut, "exceptions", listMock); sut.addError(eMock); verify(listMock, times(1)).add(eMock); }