TreePath (TreePath @NotNull [] sources, @NotNull TreePath target, @NotNull DropHandler handler) { while (target != null) { if (handler.isValidTarget(sources, target)) return target; if (!handler.shouldDelegateToParent(sources, target)) break; target = target.getParentPath(); } return null; }