### Question:
InjectorImpl implements Injector { public static InjectorBuilder builder() { return new InjectorBuilderImpl(); } InjectorImpl(
        final Set<Injectable<?>> injectables,
        final List<Object> instances,
        final Properties properties,
        final ClassLoader classLoader,
        final DependencyGraph graph,
        final InjectorBuilder builder
    ); static InjectorBuilder builder(); static InjectorBuilder builder(ClassLoader classLoader); @Override Stream<T> stream(Class<T> type); @Override T getOrThrow(Class<T> type); @Override T getAfterOrThrow(Class<T> type, T before); @Override Optional<T> get(Class<T> type); @Override Optional<T> getAfter(Class<T> type, T before); @Override Stream<Class<?>> injectables(); @Override T inject(T instance); @Override ClassLoader classLoader(); @Override void stop(); @Override InjectorBuilder newBuilder(); static final Logger LOGGER_INSTANCE; }### Answer:
@Test void stopFailed() throws InstantiationException { final Logger logger = LoggerManager.getLogger(InjectorImpl.class); final Level level = logger.getLevel(); logger.setLevel(Level.DEBUG); final Injector newInjector = Injector.builder().withComponent(Unstoppable.class).build(); try { assertThrows(InjectorException.class, newInjector::stop); } finally { logger.setLevel(level); } }
@Test void stopSkipInvocation() throws InstantiationException { final Logger logger = LoggerManager.getLogger(InjectorImpl.class); final Level level = logger.getLevel(); logger.setLevel(Level.DEBUG); final Injector newInjector = Injector.builder().withComponent(Stoppable.class).build(); try { assertDoesNotThrow(newInjector::stop); } finally { logger.setLevel(level); } }