@Override
    public void stop() throws InterruptedException, Exception {
        executor.shutdown();
        final boolean success = executor.awaitTermination(shutdownPeriod.getQuantity(), shutdownPeriod.getUnit());
        if (!success && LOG.isDebugEnabled()) {
            LOG.debug("Timeout has elapsed before termination completed for executor {}", executor);
        }
    }
@Test
    void testManaged() throws Exception {
        final String poolName = this.getClass().getSimpleName();
        when(this.exec.awaitTermination(anyLong(), any())).thenReturn(true);

        final ExecutorServiceManager test = new ExecutorServiceManager(this.exec, TEST_DURATION, poolName);

        test.start();

        verifyNoInteractions(this.exec);

        test.stop();

        verify(this.exec).shutdown();
        verify(this.exec).awaitTermination(TEST_DURATION.getQuantity(), TEST_DURATION.getUnit());
    }