### Question:
DefaultProcessorDecorator extends ProcessorDecorator { @Override public void process(final Resource resource, final Reader reader, final Writer writer) throws IOException { try { super.process(resource, reader, writer); } finally { IOUtils.closeQuietly(reader); IOUtils.closeQuietly(writer); } } DefaultProcessorDecorator(final Object processor, final boolean minimize);  DefaultProcessorDecorator(final Object processor, final ProcessingCriteria criteria); @Override void process(final Resource resource, final Reader reader, final Writer writer);  }### Answer:
@Test public void shouldPreserveContentWhenProcessingFails() throws Exception { Context.get().getConfig().setIgnoreFailingProcessor(true); Mockito.doThrow(new IOException("BOOM")).when(mockProcessor).process(Mockito.any(Resource.class), Mockito.any(Reader.class), Mockito.any(Writer.class)); final String resourceContent = "alert(1);"; final StringWriter writer = new StringWriter(); final Reader reader = new StringReader(resourceContent); victim.process(testResource, reader, writer); Mockito.verify(mockProcessor).process(Mockito.any(Resource.class), Mockito.any(Reader.class), Mockito.any(Writer.class)); Assert.assertEquals(resourceContent, writer.toString()); }