@Override
    public void execute(Runnable command) {
        synchronized (tasks) {
            tasks.add(command);
            if (!running) {
                running = true;
                parent.execute(this::run);
            }
        }
    }
@Test
    public void testSerialExecution() throws Throwable {
        Executor executor = new OrderedExecutor(SharedExecutors.getPoolThreadExecutor());
        CountDownLatch latch = new CountDownLatch(2);
        executor.execute(latch::countDown);
        executor.execute(latch::countDown);
        latch.await();
        assertEquals(0, latch.getCount());
    }