LazyRequestHandlerDecorator extends AbstractDecorator<LazyInitializer<RequestHandler>> implements RequestHandler { @Override public boolean isEnabled() { return getRequestHandler().isEnabled(); } LazyRequestHandlerDecorator(final LazyInitializer<RequestHandler> initializer); @Override void handle(final HttpServletRequest request, final HttpServletResponse response); @Override boolean accept(final HttpServletRequest request); @Override boolean isEnabled();  }
@Test public void test() { victim = new LazyRequestHandlerDecorator(new LazyInitializer<RequestHandler>() { @Override protected RequestHandler initialize() { return new CustomRequestHandler(); } }); WroTestUtils.createInjector().inject(victim); assertTrue(victim.isEnabled()); }