compare arraylists of chars alphabetically
<p>I've got my own class <code>word</code> and <code>symbol</code>. <code>Symbol</code> is some wrapper for char. <code>Word</code> is an  <code>ArrayList&lt;Symbol&gt;</code>.
I need to sort <code>ArrayList&lt;Word&gt;</code> by number of occurrences of some <code>symbol</code> or if number of occurrence is the same - alphabetically. 
How to do it? I think I need to override <code>compareto</code> method of class <code>Word</code> and then use <code>Collections.sort</code>. 
But I don't know how to compare two <code>words</code>(two arraylists) alphabetically. </p>

<p>Here is part of <code>symbol</code> class</p>

<pre><code>public class Symbol implements Comparable&lt;Symbol&gt; {
    private char symbol;
    ....

    @Override
    public int compareTo(Symbol o) {
        return Character.valueOf(symbol).compareTo(Character.valueOf(o.getSymbol()));
    }
}
</code></pre>

<p>And here is the part of <code>word</code> class</p>

<pre><code>public class Word implements Comparable&lt;Word&gt; {

    private ArrayList&lt;Symbol&gt; word;
    private Symbol comparable_symbol;

    public int count(){ //number of occurrences
        int count = 0;
        for(Symbol s:word){
            if (s == comparable_symbol) count++;
        }
        return count;
    }

    @Override
    public int compareTo(Word o) {
        int left = this.count();
        int right = o.count();
        if (left == right){
            //compare alphabetically
        }
        else return (left &gt; right)?1:-1;
    }

}
</code></pre>

<p>How to compare two arraylists alphabetically?</p>
