Guarantee at least one in a list This is a short piece of code but I feel like it could be done more elegantly. What am I missing?

The goal: if there are any items in a list, and none of them have a given property, set one of them to have that property.

static void GuaranteeAtLeastOne&lt;T&gt;(IEnumerable&lt;T&gt; list, Func&lt;T,bool&gt; getter, Action&lt;T&gt; setter)
{
    if (list.Any() &amp;&amp; !list.Any(getter))
    {
        setter(list.First());
    }
}
I wouldn't assume to go for the First, rather I'd have a Func&lt;T, bool&gt; predicate parameter which you pass to a .FirstOrDefault(predicate) and ?? it with .First()

Also, I'd verify IEnumerable&lt;T&gt; != null before anything.

static void GuaranteeAtLeastOne&lt;T&gt;(IEnumerable&lt;T&gt; list, Func&lt;T,bool&gt; getter, Action&lt;T&gt; setter, Func&lt;T,bool&gt; predicate)
{
    if (list == null || list.Count == 0 || list.Any(getter))
    {
        return;
    }

    setter(list.FirstOrDefault(predicate) ?? list.First());
}