### Question:
Application extends AbstractIdleService { public synchronized void shutdown(String event) { logger.log(Level.INFO, "Shutdown Connector {0}", event); stopAsync().awaitTerminated(); } protected  Application(AbstractBuilder<? extends AbstractBuilder, H, T> builder); void start(); synchronized void shutdown(String event); @VisibleForTesting static void setLogger(Logger logger); static final String INCREMENTAL_INTERVAL_SECONDS; static final String TRAVERSE_ON_START; static final String POLL_INTERVAL_SECONDS; static final String TRAVERSE_INTERVAL_SECONDS; static final String RUN_ONCE; }### Answer:
@Test public void shutdownHookTaskShouldCallShutdown() { ShutdownHook shutdownHook = mockApplication.new ShutdownHook(); shutdownHook.run(); verify(mockApplication).shutdown(any()); }