I am trying to compare two lists of objects when they are mix up. I have a class Sms
and another class ArchivedSms extends Sms
.
How to compare List of these objects using Collections.sort(collection, comparator)
?
List<Sms> smses = new ArrayList<Sms>();
List<ArchivedSms> archivedSmses = new ArrayList<ArchivedSms>();
smses.addAll(archivedSmses);
How to compare these objects assume they have both same fields, so I would like to compare for example phoneNumbers which are strings.