DefaultShutdownManager implements ShutdownManager { protected Optional<Exception> shutdownOne(AutoCloseable closeable) { try { closeable.close(); return Optional.empty(); } catch (Exception e) { return Optional.of(e); } } DefaultShutdownManager(Duration timeout); @Override void addShutdownHook(AutoCloseable shutdownHook); @Override Map<?, ? extends Throwable> shutdown();  }
@Test public void testShutdownOne() throws Exception { shutdownManager.shutdownOne(mockCloseable1); verify(mockCloseable1).close(); }