static @Nullable MethodHandle getToolkitInvokeMethod(boolean wait) {
    MethodHandles.Lookup lookup = MethodHandles.lookup();
    try {
      if (wait) {
        if (invokeAndWait == null) {
          invokeAndWait = lookup.findStatic(getToolkitClass(),
                                            "invokeAndWait",
                                            MethodType.methodType(void.class, Runnable.class, Component.class, boolean.class,
                                                                  int.class));
        }
        return invokeAndWait;
      }
      else {
        if (invokeLater == null) {
          invokeLater = lookup.findStatic(getToolkitClass(),
                                          "invokeLater",
                                          MethodType.methodType(void.class, Runnable.class, Component.class));
        }
        return invokeLater;
      }
    }
    catch (ClassNotFoundException e) {
      //noinspection SpellCheckingInspection
      getLogger().warn("can't find sun.lwawt.macosx.LWCToolkit, screen menu won't be filled");
      return null;
    }
    catch (IllegalAccessException | NoSuchMethodException e) {
      //noinspection SpellCheckingInspection
      getLogger().warn("can't find sun.lwawt.macosx.LWCToolkit method, screen menu won't be filled", e);
      return null;
    }
  }
static @Nullable MethodHandle getToolkitInvokeMethod(boolean wait)