The question arose while reading a answer to this question - How do I join two lists in java. This answer gave the solution
List newList = new Arra
Because you don't need a separate subclass - you just need to create a new ArrayList of the normal class, and addAll()
both lists into it.
Like so:
public static List addLists (List a, List b) {
List results = new ArrayList();
results.addAll( a);
results.addAll( b);
return results;
}
It's evil to create a subclass, that isn't needed. You don't need to extend or subclass behaviour - just change data values.