Don't know C#, but x => x != null is pretty obviously a lambda that returns 1 on references that are not null. Thus j.Count(x => x != null) is the number of objects in j that are not null and foreach (Color c in j.Where(x => x != null)) iterates over all colors in j, which are not null.