void (String action, Object element) { boolean toInterrupt = element.equals(interruptElement) && action.equals(interruptAction); if (wasInterrupted[0]) { if (myCancelRequest == null) { getBuilder().getUi().getStatus(); final String message = "Not supposed to be update after interruption request: action=" + action + " element=" + element + " interruptAction=" + interruptAction + " interruptElement=" + interruptElement; myCancelRequest = new AssertionError(message); } } else if (toInterrupt) { wasInterrupted[0] = true; switch (interruption) { case throwProcessCancelled -> throw new ProcessCanceledException(); case invokeCancel -> getBuilder().cancelUpdate(); } } }