code: public static PopupMenuListener popupMenuWillBecomeInvisible(@NonNull Consumer<PopupMenuEvent> consumer) {
        return new PopupMenuListener() {
           @Override
           public void popupMenuCanceled(PopupMenuEvent e) {
  
           }
  
           @Override
           public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
              consumer.accept(e);
           }
  
           @Override
           public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
  
           }
        };
     }
docs: Popup menu will become invisible popup menu listener.
  
  @param consumer the consumer
  @return the popup menu listener