### Question:
CopyrightKeeperProcessorDecorator extends ProcessorDecorator { public static CopyrightKeeperProcessorDecorator decorate(final ResourcePreProcessor preProcessor) { return new CopyrightKeeperProcessorDecorator(preProcessor); } private  CopyrightKeeperProcessorDecorator(final ResourcePreProcessor preProcessor); private  CopyrightKeeperProcessorDecorator(final ResourcePostProcessor postProcessor); static CopyrightKeeperProcessorDecorator decorate(final ResourcePreProcessor preProcessor); @Override void process(final Resource resource, final Reader reader, final Writer writer);  }### Answer:
@Test public void testCopyrightStripperProcessor() throws Exception { final ResourcePreProcessor decoratedProcessor = new CssMinProcessor(); final ResourcePreProcessor processor = CopyrightKeeperProcessorDecorator.decorate(decoratedProcessor); final URL url = ResourcePreProcessor.class.getResource("copyright"); final File testFolder = new File(url.getFile(), "test"); final File expectedFolder = new File(url.getFile(), "expected"); WroTestUtils.compareFromDifferentFoldersByExtension(testFolder, expectedFolder, "css", processor); }
@Test public void testCopyrightAwareProcessor() throws Exception { final ResourcePreProcessor decoratedProcessor = new ResourcePreProcessor() { public void process(final Resource resource, final Reader reader, final Writer writer) throws IOException { IOUtils.copy(reader, writer); } }; final ResourcePreProcessor processor = CopyrightKeeperProcessorDecorator.decorate(decoratedProcessor); final URL url = ResourcePreProcessor.class.getResource("copyright"); final File testFolder = new File(url.getFile(), "test"); final File expectedFolder = new File(url.getFile(), "expectedCopyrightAware"); WroTestUtils.compareFromDifferentFoldersByExtension(testFolder, expectedFolder, "css", processor); }
@Test public void testMinimizeAwareDecorator1() { final ResourcePreProcessor decoratedProcessor = new JSMinProcessor(); final ResourcePreProcessor processor = CopyrightKeeperProcessorDecorator.decorate(decoratedProcessor); Assert.assertTrue(new ProcessorDecorator(processor).isMinimize()); }
@Test public void testMinimizeAwareDecorator2() { final ResourcePreProcessor decoratedProcessor = new CssUrlRewritingProcessor(); final ResourcePreProcessor processor = CopyrightKeeperProcessorDecorator.decorate(decoratedProcessor); Assert.assertFalse(new ProcessorDecorator(processor).isMinimize()); }