Unfortuantely, I'm in Java 7 so I can't use any Java 8's facilities.
I have the following enum:
public enum Type { MAILING, RESEPT, CURRENT, //... USER } and the class container of that type:
public class Container { public Type getType() { // Impl } } Now I have some List<Container>. How can I split it into List<List<Container>> such that any List<Container> in the List<List<Container>> contains only Containers with the same getType().