### Question:
DefaultWroModelFactoryDecorator extends AbstractDecorator<WroModelFactory> implements WroModelFactory { public static WroModelFactory decorate(final WroModelFactory decorated, final List<Transformer<WroModel>> modelTransformers) { return decorated instanceof DefaultWroModelFactoryDecorator ? decorated : new DefaultWroModelFactoryDecorator( decorated, modelTransformers); } private  DefaultWroModelFactoryDecorator(final WroModelFactory decorated,
      final List<Transformer<WroModel>> modelTransformers); static WroModelFactory decorate(final WroModelFactory decorated,
      final List<Transformer<WroModel>> modelTransformers); WroModel create(); void destroy();  }### Answer:
@Test(expected = NullPointerException.class) public void cannotDecorateNullModel() { DefaultWroModelFactoryDecorator.decorate(null, emptyTransformers); }
@Test(expected = NullPointerException.class) public void cannotDecorateModelFactoryWithNullTransformers() { DefaultWroModelFactoryDecorator.decorate(new XmlModelFactory(), null); }
@Test public void shouldDecorateCacheStrategy() { final WroModelFactory original = new XmlModelFactory(); victim = DefaultWroModelFactoryDecorator.decorate(original, emptyTransformers); Assert.assertTrue(victim instanceof DefaultWroModelFactoryDecorator); Assert.assertSame(original, ((ObjectDecorator<?>) victim).getDecoratedObject()); }
@Test public void shouldNotRedundantlyDecorateCacheStrategy() { final WroModelFactory original = DefaultWroModelFactoryDecorator.decorate( new XmlModelFactory(), emptyTransformers); victim = DefaultWroModelFactoryDecorator.decorate(original, emptyTransformers); Assert.assertTrue(victim instanceof DefaultWroModelFactoryDecorator); Assert.assertSame(original, victim); }