void (@Nullable BranchType branchType, @Nullable Repository repository, @NotNull String branchName, boolean shouldBeFavorite) { if (branchType == null) return; String branchTypeName = branchType.getName(); if (shouldBeFavorite) { myBranchSettings.getExcludedFavorites().remove(branchTypeName, repository, branchName); if (!isPredefinedAsFavorite(branchType, branchName)) { myBranchSettings.getFavorites().add(branchTypeName, repository, branchName); } } else { myBranchSettings.getFavorites().remove(branchTypeName, repository, branchName); if (isPredefinedAsFavorite(branchType, branchName)) { myBranchSettings.getExcludedFavorites().add(branchTypeName, repository, branchName); } } notifyFavoriteSettingsChanged(); }