### Question:
SafeSAXParserProvider implements SAXParserProvider { public final SAXParser getSAXParser(boolean validating) throws ParserConfigurationException, SAXException { return XMLUtils.getSafeSAXParser(validating); }  final SAXParser getSAXParser(boolean validating);  }### Answer:
@Test public void shouldReturnAValidatingParserWhenAskedTo() throws Exception { SAXParser result = testProvider.getSAXParser(true); assertThat(result).isNotNull(); assertThat(result.isValidating()).isTrue(); }
@Test public void shouldReturnANonValidatingParserWhenAskedTo() throws Exception { SAXParser result = testProvider.getSAXParser(false); assertThat(result).isNotNull(); assertThat(result.isValidating()).isFalse(); }