@Override
  public <U> ParSeqBasedCompletionStage<U> applyToEitherAsync(CompletionStage<? extends T> other,
      Function<? super T, U> fn, Executor executor)
  {
    return produceEitherStageAsync("applyToEitherAsync", other, fn, executor);
  }
@Test
  public void testApplyToEitherAsync() throws Exception
  {
    Consumer<String> consumer = mock(Consumer.class);
    CountDownLatch waitLatch = new CountDownLatch(1);

    CompletionStage<String> completionStage = createTestStage(TESTVALUE1);
    CompletionStage<String> completionStage2 = createTestStage(TESTVALUE2);
    finish(completionStage.applyToEitherAsync(completionStage2, r -> {
      assertEquals(THREAD_NAME_VALUE, Thread.currentThread().getName());
      waitLatch.countDown();
      return r;
    }, _mockExecutor).thenAccept(consumer));

    assertTrue(waitLatch.await(1000, TimeUnit.MILLISECONDS));
  }