private static @NlsSafe String getKeyStrokeText(@NotNull JMenuItem item) {
    return item instanceof ActionMenuItem
           ? ((ActionMenuItem)item).getFirstShortcutText()
           : getKeyStrokeText(item.getAccelerator());
  }
private static @NlsSafe String getKeyStrokeText(@NotNull JMenuItem item)