Collection<KeyStroke> (@NotNull ShortcutSet shortcutSet) { Shortcut[] shortcuts = shortcutSet.getShortcuts(); if (shortcuts.length == 0) { return Collections.emptySet(); } Set<KeyStroke> result = new HashSet<>(); for (Shortcut shortcut : shortcuts) { if (!(shortcut instanceof KeyboardShortcut kbShortcut)) { continue; } if (kbShortcut.getSecondKeyStroke() != null) { continue; } result.add(kbShortcut.getFirstKeyStroke()); } return result.isEmpty() ? Collections.emptySet() : result; }