I was going through the GroupBy method in LINQ :
public static IEnumerable> GroupBy(
this IEnum
You've provided a nonsensical equality comparer, so your results are going to be nonsensical. Your hash code is based on the reference to the comparer itself, which has nothing to do with anything in your Equals method, and in your Equals method you're saying that two objects are equal if the first object is as long or longer than the second string. This just makes no sense, it even violates basic properties of equality in that the order of the parameters should be irrelevant.