title: Sorting objects of different types into one list
body: <p>I have the following problem and I'm not quite sure how to go about solving it. I am requesting data from several different servers with each server returning a list of objects of a different type (every server has it's own specific unique POJO object type) - but what all these lists of objects have in common is that all the objects have a date parameter. I then need to display the objects from all the lists as one huge mixed list for the user, with all the various objects sorted by date. </p>
  
  <p>I made an adapter that extends baseadapter and I've passed all the arraylists of objects to that adapter - but how can I sort all these lists of objects by date and display them all together? I could create a "super object" that has the properties of all the other objects and then make one sorted array of this super object to pass to the adapter, but that seems like a messy and crude solution. Is there a more or less elegant way to do this?</p>
  
  <pre><code>public class someAdapter extends BaseAdapter
  {
  ...
  
  public someAdapter(ArrayList&lt;ObjectOne&gt; objectOneArray, ArrayList&lt;ObjectTwo&gt; objectTwoArray) {
          if (objectOneArray != null) {
              this.localObjectOneList.addAll(objectOneArray);
          }
          ...
  }
  }
  </code></pre>
  
  <p>Example of an object type:</p>
  
  <pre><code>public class ObjectOne implements Serializable {
  private String date;
  private String someFieldOne;
  private String someFieldTwo;
  
  ...
  //getters and setters
  ...
  }
  </code></pre>
  
  <p>To reiterate - the final list has to be a mix of all the different object types in the order of their dates. </p>