Suppose I have two classes CLassA and CLassB. And they have one atributte in common, for example the number of elements that each class holds.
How can i create a collect
You could make a custom java.util.Comparator and sort using the Collections.sort(List list, Comparator c) method.