I have lists containing lists in three levels. Im using JPA to get this data from three different database tables.
On more details, I have three different objects (Group, Type, Item): a group that contains a List of Types that contains a List of Items.
I want to get only a few Items from different Types and Groups and return this Items like a List.
The question is: Is there a elegant and simple way to do this? Or I really need to get all the Items and group them level by level?
Guava might provide a nice solution:
or expanded:
There might be a way to use Predicates / Functions compose methods to shorten this.
Guava is here