boolean (final @NotNull Shortcut sc) { if (sc instanceof KeyboardShortcut other) { return myFirstKeyStroke.equals(other.myFirstKeyStroke) && (other.mySecondKeyStroke == null || other.mySecondKeyStroke.equals(mySecondKeyStroke)); } else { return false; } }