title: Java8 Lambdas vs Anonymous classes
body: <p>Since Java8 has been recently released and its brand new lambda expressions looks to be really cool, I was wondering if this means the demise of the Anonymous classes that we were so used to.</p>
  
  <p>I've been researching a bit about this and found some cool examples about how Lambda expressions will systematically replace those classes, such the Collection's sort method, which used to get an Anonymous instance of Comparator to perform the sort: </p>
  
  <pre><code>Collections.sort(personList, new Comparator&lt;Person&gt;(){
    public int compare(Person p1, Person p2){
      return p1.firstName.compareTo(p2.firstName);
    }
  });
  </code></pre>
  
  <p>Now can be done using Lambdas: </p>
  
  <pre><code>Collections.sort(personList, (Person p1, Person p2) -&gt; p1.firstName.compareTo(p2.firstName));
  </code></pre>
  
  <p>And looks surprisingly concise. So my question is, is there any reason to keep using those classes in Java8 instead of Lambdas?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Same question but in the opposite direction, what are the benefits of using Lambdas instead of Anonymous classes, since Lambdas can only be used with single method interfaces, is this new feature only a shortcut only used in few cases or is it really useful?</p>