public static int getNumOfTopShownBranches(@NotNull List<? extends BranchActionGroup> branchActions) {
    int numOfFavorites = getNumOfFavorites(branchActions);
    if (branchActions.size() > MAX_NUM) {
      if (numOfFavorites > 0) return numOfFavorites;
      return DEFAULT_NUM;
    }
    return MAX_NUM;
  }
public static int getNumOfTopShownBranches(@NotNull List<? extends BranchActionGroup> branchActions)