boolean (@NotNull Window parent, Object potentialChild) { return parent == potentialChild || (potentialChild instanceof Component) && isParentWindow(parent, ((Component)potentialChild).getParent()); }