### Question:
ToolspecValidator { private void check(boolean condition, ErrType errType, String errMsg) { if (condition) { errors.add(new Error(errType, errMsg)); if (errType.equals(ErrType.ERROR)) { this.valid = false; } } } ToolspecValidator(Toolspec toolspec, Configuration ioc); void validateWithXMLSchema(); void validate(); boolean isValid(); void checkpoint(); void addError(Error err);  }### Answer:
@Test public void testCheck() { try { Configuration ioc = new Configuration(); URL url = this.getClass().getResource("/layoutevaluation.xml"); File testXml = new File(url.getFile()); ioc.setXmlConf(testXml); ioc.setProjConf(new File(Constants.DEFAULT_PROJECT_PROPERTIES)); JAXBContext context; context = JAXBContext .newInstance("eu.impact_project.iif.tw.toolspec"); Unmarshaller unmarshaller = context.createUnmarshaller(); Toolspec toolspec = (Toolspec) unmarshaller.unmarshal(new File(ioc .getXmlConf())); ToolspecValidator tv = new ToolspecValidator(toolspec, ioc); tv.validate(); fail("Should raise exception"); } catch (GeneratorException ex) { } catch (JAXBException ex) { } }