public static Optional<CeTaskInterruptedException> isTaskInterruptedException(Throwable e) {
    if (e instanceof CeTaskInterruptedException ceTaskInterruptedException) {
      return Optional.of(ceTaskInterruptedException);
    }
    return isCauseInterruptedException(e);
  }
@Test
  public void isCauseInterruptedException_returns_CeTaskInterruptedException_or_subclass_in_cause_chain() {
    String message = randomAlphabetic(50);
    CeActivityDto.Status status = randomStatus();
    CeTaskInterruptedException e1 = new CeTaskInterruptedException(message, status) {

    };
    CeTaskInterruptedException e2 = new CeTaskInterruptedExceptionSubclass(message, status);

    assertThat(isTaskInterruptedException(new RuntimeException(e1))).contains(e1);
    assertThat(isTaskInterruptedException(new Exception(new RuntimeException(e2)))).contains(e2);
  }