private static @NotNull AbstractAction applyColor(Ref<LightCalloutPopup> ref) {
    return new AbstractAction() {
      @Override
      public void actionPerformed(ActionEvent e) {
        final LightCalloutPopup popup = ref.get();
        if (popup != null) {
          popup.close();
        }
      }
    };
  }
private static @NotNull AbstractAction applyColor(Ref<LightCalloutPopup> ref)