Check if all items are equal

You should have a look at the working with groups design pattern from @rlkoshak