private static @NotNull Action createAction(@NotNull Consumer<ActionEvent> perform) {
    return new AbstractAction() {
      @Override
      public void actionPerformed(ActionEvent e) {
        perform.accept(e);
      }
    };
  }
private static @NotNull Action createAction(@NotNull Consumer<ActionEvent> perform)