Sorting list of objects
<p>I have a list of objects:</p>

<pre><code>List&lt;WorkflowError&gt; workflowErrors = new List&lt;WorkflowError&gt;();
</code></pre>

<p>Of which I am wanting to sort alphabetically on the string field errorCode.</p>

<p>I know I have to use</p>

<pre><code>Collections.sort(list,comparator) 
</code></pre>

<p>and write a custom Comparator:</p>

<pre><code>public class SortByErrorComparator implements Comparator&lt;WorkflowError&gt;
{
    // Comparator logic    
    return 0;
}
</code></pre>

<p>I have seen examples of how to do this for a one dimensional list but I can't work out how to begin for a list of objects.</p>

<p>Any help would be appreciated.</p>
