Action (@NotNull TreePath path, T component) { if (component == null) return Action.SKIP_CHILDREN; int count = path.getPathCount(); if (count < this.count) { TreePath parent = this.path.getParentPath(); while (++count < this.count && parent != null) parent = parent.getParentPath(); boolean found = parent != null && matches(component, parent.getLastPathComponent()); return !found ? Action.SKIP_CHILDREN : Action.CONTINUE; } else { boolean found = count > this.count || matches(component, this.path.getLastPathComponent()); return !found ? Action.SKIP_CHILDREN : visit(path, component, count - this.count); } }