@Override
  public ParSeqBasedCompletionStage<T> whenComplete(BiConsumer<? super T, ? super Throwable> action)
  {
    return nextStageByComposingTask(_task.transform("whenComplete", prevTaskResult -> {
      if (prevTaskResult.isFailed()) {
        try {
          action.accept(null, prevTaskResult.getError());
        } catch (Throwable e) {
          // no ops
        }
        return Failure.of(prevTaskResult.getError());
      } else {
        try {
          action.accept(prevTaskResult.get(), prevTaskResult.getError());
        } catch (Throwable e) {
          return Failure.of(e);
        }
        return Success.of(prevTaskResult.get());
      }
    }));
  }
@Test
  public void testWhenComplete_withException() throws Exception
  {
    BiConsumer<String, Throwable> biConsumer = mock(BiConsumer.class);
    CompletionStage<String> stage = createTestFailedStage(EXCEPTION).whenComplete(biConsumer);
    finish(stage);
    verify(biConsumer, times(1)).accept(null, EXCEPTION);
  }