### Question:
SafeDocumentBuilderProvider implements DocumentBuilderProvider { public DocumentBuilder getDocumentBuilder(boolean validating) throws ParserConfigurationException { return XMLUtils.getSafeDocumentBuilder(validating); }  DocumentBuilder getDocumentBuilder(boolean validating);  }### Answer:
@Test public void shouldReturnValidatingDocumentBuildersWhenAsked() throws Exception { DocumentBuilder validatingBuilder = testProvider.getDocumentBuilder(true); assertThat(validatingBuilder.isValidating()).isTrue(); }
@Test public void shouldReturnNonValidatingDocumentBuildersWhenAsked() throws Exception { DocumentBuilder nonValidatingBuilder = testProvider.getDocumentBuilder(false); assertThat(nonValidatingBuilder.isValidating()).isFalse(); }