title: Java8 lambda convert List to Map of Maps
body: <p>Is it possible to transform <code>List&lt;Entry&gt;</code> to <code>Map&lt;Employee, Map&lt;LocalDate, Entry&gt;&gt;</code> with one lambda expression?</p>
  
  <pre><code>public class Entry {
      Employee employee;
      LocalDate date;
  }
  </code></pre>
  
  <p>So far i have came up with something like this:</p>
  
  <pre><code>entries.stream().collect(Collectors.toMap(Collectors.groupingBy(Entry::getEmployee), Collectors.groupingBy(Entry::getDate), Function.identity()));
  </code></pre>
  
  <p>But this gives a compilation error:</p>
  
  <pre><code>no suitable method found for 
  toMap(java.util.stream.Collector&lt;com.a.Entry,capture#1 of ?,java.util.Map&lt;com.a.Employee,
  java.util.List&lt;com.a.Entry&gt;&gt;&gt;‌​,java.util.stream.Co‌​llector&lt;com.a.Entry,‌​capture#2 of ?, 
  java.util.Map&lt;java.time.LocalDate,java.util.List&lt;com.a.Ent‌ry&gt;&gt;&gt;,
  java.util.func‌​tion.Function&lt;java.l‌​ang.Object,java.lang‌​.Object&gt;) 
  </code></pre>
  
  <p>Thanks</p>