package org.requirementsascode;

import java.util.function.Predicate;

public class InterruptingFlowStep extends FlowStep {
    private static final long serialVersionUID = 7204738737376844201L;

    InterruptingFlowStep(String stepName, UseCase useCase, Flow useCaseFlow) {
	super(stepName, useCase, useCaseFlow);
    }

    public Predicate<UseCaseModelRunner> getCondition() {
	Predicate<UseCaseModelRunner> condition;
	Predicate<UseCaseModelRunner> reactWhile = getReactWhile();

	if (reactWhile != null) {
	    condition = reactWhile;
	} else {
	    condition = getFlowCondition();
	}

	return condition;
    }

    private Predicate<UseCaseModelRunner> getFlowCondition() {
	Predicate<UseCaseModelRunner> flowPosition = getFlowPosition();
	Predicate<UseCaseModelRunner> when = getWhen().orElse(r -> true);

	Predicate<UseCaseModelRunner> flowCondition = isRunnerInDifferentFlow().and(flowPosition).and(when);
	return flowCondition;
    }

    private Predicate<UseCaseModelRunner> isRunnerInDifferentFlow() {
	Predicate<UseCaseModelRunner> isRunnerInDifferentFlow = runner -> runner.getLatestFlow()
		.map(runnerFlow -> !runnerFlow.equals(getFlow())).orElse(true);
	return isRunnerInDifferentFlow;
    }
}

@@ -556,27 +556,26 @@
 condition = 
-get
+is
 FlowConditio
@@ -571,24 +571,52 @@
 lowCondition
+TrueAndRunnerInDifferentFlow
 ();%0A%09%7D%0A%0A%09ret
@@ -679,19 +679,18 @@
 Runner%3E 
-get
+is
 FlowCond
@@ -686,32 +686,60 @@
  isFlowCondition
+TrueAndRunnerInDifferentFlow
 () %7B%0A%09Predicate%3C

Improve method name