bootstrap.declareBean(Properties.class, Scope.SINGLETON, null, null);
bootstrap.bindBean(HashSet.class, null, singleton);
Injector injector = bootstrap.get();
bootstrap.declareBean(Date.class, Scope.SINGLETON, null, null);
boot();
InjectionContext context = boot(injector);
//
Properties p1 = getBean(Properties.class);
Properties p2 = getBean(Properties.class);
assertSame(p1, p2);
Date s1 = getBean(Date.class);
Date s2 = getBean(Date.class);
assertSame(s1, s2);
assertSame(singleton, getBean(HashSet.class));
//
Properties p3 = getBean(context, Properties.class);
Properties p4 = getBean(context, Properties.class);
assertSame(p3, p4);
assertNotSame(p1, p3);
if (di != InjectorProvider.GUICE) {
assertNull(context.get(Date.class));
}
assertSame(singleton, getBean(context, HashSet.class));
}