### Question:
SessionLoader { public void destroy() { initializers.forEach(SessionInitializer::destroy); initializers.clear(); initializerInstances.destroyAll(); } @Inject  SessionLoader(final DefinitionUtils definitionUtils,
                         final StunnerPreferencesRegistryLoader preferencesRegistryLoader,
                         final @Any ManagedInstance<SessionInitializer> beanInstances); void load(final Metadata metadata,
                     final ParameterizedCommand<StunnerPreferences> completeCallback,
                     final ParameterizedCommand<Throwable> errorCallback); void destroy();  }### Answer:
@Test @SuppressWarnings("unchecked") public void testDestroy() { ParameterizedCommand<StunnerPreferences> completeCallback = mock(ParameterizedCommand.class); ParameterizedCommand<Throwable> errorCallback = mock(ParameterizedCommand.class); sessionLoader.load(metadata, completeCallback, errorCallback); sessionLoader.destroy(); verify(initializer, atLeastOnce()).destroy(); verify(initializerInstances, times(1)).destroyAll(); assertTrue(sessionLoader.getInitializers().isEmpty()); }