boolean (@NotNull Component ancestor, @NotNull Component descendant) { do { if (descendant == ancestor) { return true; } descendant = getParent(descendant); } while (descendant != null); return false; }