private static void forEachComponent(@NotNull Container container, @NotNull Consumer<? super Component> consumer) {
    consumer.accept(container);
    for (Component component : container.getComponents()) {
      consumer.accept(component);
    }
  }
private static void forEachComponent(@NotNull Container container, @NotNull Consumer<? super Component> consumer)