IkasoaFactoryFactory { public IkasoaFactory getIkasoaNettyFactory() { return Optional.ofNullable(configurator).map(NettyIkasoaFactory::new).orElse(new NettyIkasoaFactory()); }  IkasoaFactory getIkasoaDefaultFactory(); IkasoaFactory getIkasoaNettyFactory(); IkasoaFactory getIkasoaServletFactory();  }
@Test public void testGetIkasoaNettyFactory() { IkasoaFactoryFactory factory1 = new IkasoaFactoryFactory(); assertNotNull(factory1.getIkasoaNettyFactory()); IkasoaFactoryFactory factory2 = new IkasoaFactoryFactory(new Configurator()); assertNotNull(factory2.getIkasoaNettyFactory()); assertTrue(factory1.getIkasoaNettyFactory() instanceof NettyIkasoaFactory && factory2.getIkasoaNettyFactory() instanceof NettyIkasoaFactory); }