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

    TransformExecutorService serial = TransformExecutorServices.serial(executorService);
    serial.schedule(first);
    thrown.expect(IllegalStateException.class);
    thrown.expectMessage("unexpected currently executing");

    serial.complete(second);
  }