### Question:
DefaultInjector implements Injector { @Override public synchronized void shutdown() { if(isShutdown) { return; } isShutdown = true; singletonScope.shutdown(); bindings.clear(); decorations.clear(); injectionStack.reset(); keysByRawType.clear(); } DefaultInjector(BQModule... modules);  DefaultInjector(Set<Options> options, InjectorPredicates predicates, BQModule... modules); @Override T getInstance(Class<T> type); @Override T getInstance(Key<T> key); @Override Provider<T> getProvider(Class<T> type); @Override Provider<T> getProvider(Key<T> key); @Override boolean hasProvider(Class<?> type); @Override boolean hasProvider(Key<?> key); @Override @SuppressWarnings("unchecked") void injectMembers(Object object); @Override synchronized void shutdown(); @SuppressWarnings({"unchecked", "rawtypes"}) @Override Collection<Key<T>> getKeysByType(Class<T> type);  }### Answer:
@Test public void testShutdown() { MockImplementation1_EventAnnotations.reset(); BQModule module = binder -> binder .bind(MockInterface1.class) .to(MockImplementation1_EventAnnotations.class) .inSingletonScope(); DefaultInjector injector = new DefaultInjector(module); MockInterface1 instance1 = injector.getInstance(MockInterface1.class); assertEquals("XuI", instance1.getName()); assertFalse(MockImplementation1_EventAnnotations.shutdown1); assertFalse(MockImplementation1_EventAnnotations.shutdown2); assertFalse(MockImplementation1_EventAnnotations.shutdown3); injector.shutdown(); assertTrue(MockImplementation1_EventAnnotations.shutdown1); assertTrue(MockImplementation1_EventAnnotations.shutdown2); assertTrue(MockImplementation1_EventAnnotations.shutdown3); }