boolean (@NotNull ContentManager manager, @NotNull Condition<? super JComponent> condition) { for (Content content : manager.getContents()) { if (content instanceof TabbedContent tabbedContent && ((TabbedContent)content).hasMultipleTabs()) { JComponent component = findContentComponent(tabbedContent, condition); if (component != null) { tabbedContent.removeContent(component); return true; } } else if (condition.value(content.getComponent())) { manager.removeContent(content, true); return true; } } return false; }