boolean (@NotNull ActionGroup group, boolean processPopupSubGroups, @NotNull Predicate<? super AnAction> condition) { for (AnAction child : group.getChildren(null)) { if (condition.test(child)) return true; if (child instanceof ActionGroup childGroup) { if ((processPopupSubGroups || !childGroup.isPopup()) && anyActionFromGroupMatches(childGroup, processPopupSubGroups, condition)) { return true; } } } return false; }