### Question:
AsyncXCommandExecutor { public void shutdown() { try { shutdownExecutor(executor, "executor"); shutdownExecutor(scheduledExecutor, "scheduled executor"); } catch (InterruptedException e) { log.warn("Interrupted while waiting for executor shutdown"); } } @SuppressWarnings({"unchecked", "rawtypes"}) @SuppressFBWarnings( value = "SIC_INNER_SHOULD_BE_STATIC_ANON", justification = "Unnecessary to refactor innen classes defined here")  AsyncXCommandExecutor(int threads,
            int delayedCallableThreads,
            boolean needConcurrencyCheck,
            CallableQueueService callableAccess,
            long maxActiveCommands,
            long maxWait,
            int priorities,
            int awaitTerminationTimeoutSeconds); @VisibleForTesting  AsyncXCommandExecutor(boolean needConcurrencyCheck,
            CallableQueueService callableAccess,
            long maxActiveCommands,
            ThreadPoolExecutor executor,
            ScheduledThreadPoolExecutor scheduledExecutor,
            PriorityBlockingQueue<CallableWrapper<?>> priorityBlockingQueue,
            BlockingQueue<AccessibleRunnableScheduledFuture<ScheduledXCallable>> delayQueue,
            ConcurrentHashMap<String, Set<CallableWrapper<?>>> pendingCommandsPerType,
            AtomicInteger activeCommands,
            long maxWait,
            long priorities,
            int awaitTerminationTimeoutSeconds); synchronized boolean queue(CallableWrapper<?> wrapper, boolean ignoreQueueSize); void handleConcurrencyExceeded(CallableWrapper<?> command); void checkMaxConcurrency(String type); void commandFinished(); ThreadPoolExecutor getExecutorService(); void shutdown(); boolean isShutDown(); boolean isTerminated(); List<String> getQueueDump(); int getSize(); static final int MIN_PRIORITY; static final long ANTI_STARVATION_INTERVAL; }### Answer:
@Test public void testShutDown() throws InterruptedException { when(executor.awaitTermination(anyLong(), any(TimeUnit.class))).thenReturn(true); when(scheduledExecutor.awaitTermination(anyLong(), any(TimeUnit.class))).thenReturn(true); asyncExecutor.shutdown(); verify(executor).shutdown(); verify(executor).awaitTermination(eq(1000L), eq(TimeUnit.MILLISECONDS)); verify(scheduledExecutor).shutdown(); verify(scheduledExecutor).awaitTermination(eq(1000L), eq(TimeUnit.MILLISECONDS)); }