public static TransformExecutorService serial(ExecutorService executor) {
    return new SerialTransformExecutor(executor);
  }
@Test
  public void serialScheduleTwoWaitsForFirstToComplete() {
    @SuppressWarnings("unchecked")
    DirectTransformExecutor<Object> first = mock(DirectTransformExecutor.class);
    @SuppressWarnings("unchecked")
    DirectTransformExecutor<Object> second = mock(DirectTransformExecutor.class);

    TransformExecutorService serial = TransformExecutorServices.serial(executorService);
    serial.schedule(first);
    verify(first).run();

    serial.schedule(second);
    verify(second, never()).run();

    serial.complete(first);
    verify(second).run();

    serial.complete(second);
  }