I have a List<type1> listOfObjects and a static method
bool CheckIfObjectsAreEquivalent(type1 obj1, type1 obj2).
I would like to group the list by the equivalence criteria, i.e. have List<List<type1>> result where each list consists of the objects that are equivalent according to CheckIfObjectsAreEquivalent.
Another important aspect is, that I do not know upfront how many different lists will result from this grouping, as all objects could be equivalent or none or any possible number of equivalence groups. The initial list of objects listOfObjects can consist of variously many objects and to see if two of those objects are equivalent one must use CheckIfObjectsAreEquivalent.
I've been looking into different options using .Where and .GroupBy but I can't get it to work...
Any ideas? Thanks in advance