### Question:
PrioritizedFifoExecutor { public ListenableFuture<?> submit(T task) { FifoRunnableTask<T> fifoTask = new FifoRunnableTask<>(task, sequenceNumber.incrementAndGet(), taskComparator); queue.add(fifoTask); executorService.submit(triggerTask); return fifoTask; } PrioritizedFifoExecutor(ExecutorService coreExecutor, int maxThreads, Comparator<T> taskComparator); ListenableFuture<?> submit(T task);  }### Answer:
@Test public void testCounter() throws Exception { PrioritizedFifoExecutor<Runnable> executor = new PrioritizedFifoExecutor<>(this.executor, 1, DUMMY_COMPARATOR); int totalTasks = 100_000; AtomicInteger counter = new AtomicInteger(); CountDownLatch startLatch = new CountDownLatch(1); CountDownLatch completeLatch = new CountDownLatch(totalTasks); List<Future<?>> futures = new ArrayList<>(); for (int i = 0; i < totalTasks; i++) { int taskNumber = i; futures.add(executor.submit(() -> { try { awaitUninterruptibly(startLatch, 1, TimeUnit.MINUTES); assertFalse(futures.get(taskNumber).isDone()); int initialCount = counter.get(); counter.set(initialCount + 1); } finally { completeLatch.countDown(); } })); } for (Future<?> future : futures) { assertFalse(future.isDone()); } startLatch.countDown(); awaitUninterruptibly(completeLatch, 1, TimeUnit.MINUTES); assertEquals(counter.get(), totalTasks); futures.get(futures.size() - 1).get(1, TimeUnit.MINUTES); for (Future<?> future : futures) { assertTrue(future.isDone()); } }