void (Container container, ComponentOperation operation) { Component[] components = container.getComponents(); for (Component component : components) { if (!component.isVisible()) continue; operation.applyTo(component); } }