private static void initializeDesktop(Desktop desktop) {
    // This enables deeper integration with the macOS system menu bar as well as GNOME's application
    // menu.
    // Note that any of these might independently fail, and we simply ignore the error; different
    // platforms implement different subsets of the desktop API.
    try {
      desktop.setAboutHandler(
          e -> {
            if (controller != null) {
              controller.showAboutDialog();
            }
          });
    } catch (UnsupportedOperationException e) {
      /* Ignore */
    }
    try {
      desktop.setPreferencesHandler(
          e -> {
            if (controller != null) {
              controller.showMainSettingsDialog();
            }
          });
    } catch (UnsupportedOperationException e) {
      /* Ignore */
    }
    try {
      desktop.setQuitHandler(
          (e, response) -> {
            if (controller != null) {
              controller.exitBinDiff();
            }
          });
    } catch (UnsupportedOperationException e) {
      /* Ignore */
    }

    desktopIntegrationDone = true;
  }
Parses command line arguments.

@param args the arguments, as passed into {@link #main(String[])}.
@return a list of positional arguments without any options or {@code null} on error.
java/ui/src/main/java/com/google/security/zynamics/bindiff/BinDiff.java