Action (@NotNull TreePath path) { Object node = path.getLastPathComponent(); if (node.equals(myPath.peek())) { myPath.poll(); return myPath.isEmpty() ? Action.INTERRUPT : Action.CONTINUE; } return Action.SKIP_CHILDREN; }