public void testConstantFactoryConstant() { Integer constant = new Integer(9); Factory factory = FactoryUtils.constantFactory(constant); assertNotNull(factory); Object created = factory.create(); assertSame(constant, created); }
public void testConstantFactoryNull() { Factory factory = FactoryUtils.constantFactory(null); assertNotNull(factory); Object created = factory.create(); assertNull(created); }
public void testLazyMapFactory() { Factory factory = FactoryUtils.constantFactory(new Integer(5)); Map map = MapUtils.lazyMap(new HashMap(), factory); assertTrue(map instanceof LazyMap);