@Test(timeout = 2000)
public void shouldEvaluateToTrueUnderMultiThreadEnv() {

  var forkJoinPool = new ForkJoinPool(32);
  var results = forkJoinPool.submit(() -> IntStream.range(0, 10000)
      .parallel()
      .mapToObj(i -> terminationHandler.retryConditionMet(
          RunState.create(WORKFLOW_INSTANCE, FAILED,
              StateData.newBuilder()
                  .tries(3)
                  .consecutiveFailures(2)
                  .trigger(Trigger.natural())
                  .build()),
          Optional.of(1),
          "#exitCode == 1 && (#tries < 3 || #consecutiveFailures < 4) && #triggerType == \"natural\"")))
      .join()
      .collect(toList());
  forkJoinPool.shutdownNow();
  results.forEach(result -> assertThat(result, is(true)));
}