private static @NotNull Condition<AnAction> wrapFilter(@Nullable Condition<? super AnAction> filter,
                                                         @Nullable Keymap keymap) {
    ActionManager actionManager = ActionManager.getInstance();
    ActionShortcutRestrictions shortcutRestrictions = ActionShortcutRestrictions.getInstance();
    return action -> {
      if (action == null) return false;
      final String id = actionManager.getId(action);
      if (id != null) {
        if (!Registry.is("keymap.show.alias.actions")) {
          String binding = ActionManagerEx.getInstanceEx().getActionBinding(id);
          boolean bound = binding != null
                          && actionManager.getAction(binding) != null // do not hide bound action, that miss the 'bound-with'
                          && !hasAssociatedShortcutsInHierarchy(id, keymap); // do not hide bound actions when they are redefined
          if (bound) {
            return false;
          }
        }
        if (!shortcutRestrictions.getForActionId(id).allowChanging) {
          return false;
        }
      }

      return filter == null || filter.value(action);
    };
  }
private static @NotNull Condition<AnAction> wrapFilter(@Nullable Condition<? super AnAction> filter,
                                                         @Nullable Keymap keymap)