/** * Checks if the user's condition for a custom event is satisfied. * * @param condition is the condition to check. * @return {@code true} if the condition is satisfied; {@code false} otherwise. */ private boolean callUserCode(Condition condition) { boolean conditionSatisfied; robotProxy.setTestingCondition(true); try { conditionSatisfied = condition.test(); } finally { robotProxy.setTestingCondition(false); } return conditionSatisfied; }