public static void iterateChildren(Component container, Consumer<? super Component> consumer, JComponent... excludeComponents) {
    if (excludeComponents != null && ArrayUtilRt.find(excludeComponents, container) != -1) {
      return;
    }

    consumer.accept(container);
    if (container instanceof Container) {
      Component[] components = ((Container)container).getComponents();
      for (Component child : components) {
        iterateChildren(child, consumer, excludeComponents);
      }
    }
  }
public static void iterateChildren(Component container, Consumer<? super Component> consumer, JComponent... excludeComponents)