Get unique List elements based on a substring
<p>I have an ArrayList(String) which contains a list of formatted dates like this:</p>

<pre><code>element 1: "2012-5-1"
element 2: "2012-8-10"
element 3: "2012-12-5"
element 4: "2013-12-21"
element 5: "2013-12-13"
element 6: "2014-5-8"
</code></pre>

<p>What is the most efficient/framework way to create another list or normal primitive array that contains the unique year entries? For example my new list would contain:</p>

<pre><code>element 1: "2012"
element 2: "2013"
element 3: "2014"
</code></pre>
