### Question:
AsyncXCommandExecutor { public List<String> getQueueDump() { List<CallableWrapper<?>> copyOfPending = new ArrayList<>(100); List<String> queueDump = new ArrayList<>(100); for (Map.Entry<String, Set<CallableWrapper<?>>> entry : pendingCommandsPerType.entrySet()) { Set<CallableWrapper<?>> pendingCommandsPerType = entry.getValue(); copyOfPending.addAll(pendingCommandsPerType); } for (final CallableWrapper<?> wrapper : priorityBlockingQueue) { queueDump.add(wrapper.toString()); } for (final AccessibleRunnableScheduledFuture<ScheduledXCallable> future : delayWorkQueue) { ScheduledXCallable delayedXCallable = (ScheduledXCallable) future.getTask(); queueDump.add(delayedXCallable.getCallableWrapper().toString()); } for (final CallableWrapper<?> wrapper : copyOfPending) { queueDump.add(wrapper.toString()); } return queueDump; } @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 testQueueDump() { CallableWrapper<?> pendingCallable = mock(CallableWrapper.class); CallableWrapper<?> waitingCallable = mock(CallableWrapper.class); ScheduledXCallable delayedXCallable = mock(ScheduledXCallable.class); @SuppressWarnings("unchecked") AccessibleRunnableScheduledFuture<ScheduledXCallable> asrf = mock(AccessibleRunnableScheduledFuture.class); Mockito.<CallableWrapper<?>>when(delayedXCallable.getCallableWrapper()).thenReturn(waitingCallable); when(asrf.getTask()).thenReturn(delayedXCallable); when(pendingCallable.toString()).thenReturn("pendingCallable"); when(waitingCallable.toString()).thenReturn("waitingCallable"); when(callableWrapper.toString()).thenReturn("callableWrapper"); priorityBlockingQueue.add(callableWrapper); delayQueue.add(asrf); pendingCommandsPerType.put(DEFAULT_TYPE, Sets.newHashSet(pendingCallable)); List<String> queueDump = asyncExecutor.getQueueDump(); assertEquals("Size", 3, queueDump.size()); assertTrue("PendingCallable not found", queueDump.contains("pendingCallable")); assertTrue("WaitingCallable not found", queueDump.contains("waitingCallable")); assertTrue("CallableWrapper not found", queueDump.contains("callableWrapper")); }