private static @Nullable Color calculateGreyBackground(@NotNull List<? extends RefGroup> refGroups,
                                                         @NotNull Color background,
                                                         boolean isSelected,
                                                         boolean isCompact) {
    if (isSelected) return null;
    if (!isCompact) return getBranchPresentationBackground(background);

    boolean paintGreyBackground;
    for (RefGroup group : refGroups) {
      if (group.isExpanded()) {
        paintGreyBackground = ContainerUtil.find(group.getRefs(), ref -> !ref.getName().isEmpty()) != null;
      }
      else {
        paintGreyBackground = !group.getName().isEmpty();
      }

      if (paintGreyBackground) return getBranchPresentationBackground(background);
    }

    return null;
  }
private static @Nullable Color calculateGreyBackground(@NotNull List<? extends RefGroup> refGroups,
                                                         @NotNull Color background,
                                                         boolean isSelected,
                                                         boolean isCompact)