I hit my head and could not find a logic to do that. Well, I have a list of objects (Police): List and these objects have several properties, such as: organization, year, context and others.
What I need is to pass this list by one method and have the rest of a list of lists with the grouping of policies that have the same organization, year, and context.
If for example I have these 4 policies:
P1 - organização: USP, ano: 2015, contexto: A
P2 - organização: USP, ano: 2015, contexto: A
P3 - organização: UFCG, ano: 2014, contexto: B
P4 - organização: UFCG, ano:2014, contexto B
The objects P1 and P2 and the objects P3 and P4 are similar, the return should be two lists, one with P1 and P2 and one with P3 and P4. Could someone help me with logic? Thank you!