private static void alignPanels(JComponent container) {
    List<PanelWithAnchor> panels =
      Arrays.stream(container.getComponents())
        .filter(component -> component.isVisible())
        .filter(component -> component instanceof PanelWithAnchor)
        .map(component -> (PanelWithAnchor)component)
        .collect(Collectors.toList());
    UIUtil.mergeComponentsWithAnchor(panels, true);
  }
private static void alignPanels(JComponent container)