public final synchronized void remove(@NotNull AnAction action, @Nullable String id) {
    Predicate<AnAction> matchesAction = o -> o.equals(action) || (o instanceof ActionStubBase stub && stub.getId().equals(id));
    boolean removed = mySortedChildren.removeIf(matchesAction);
    removed = removed || myPendingActions.removeIf(matchesAction);
    myConstraints.keySet().removeIf(matchesAction);
    if (removed) {
      incrementModificationStamp();
    }
  }
public final synchronized void remove(@NotNull AnAction action, @Nullable String id)