title: Java8 group a list of lists to map
body: <p>I have a <code>Model</code> and a <code>Property</code> class with the following signatures:</p>
  
  <pre><code>public class Property {
  
      public String name;
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  }
  
  public class Model {
  
      private List&lt;Property&gt; properties = new ArrayList&lt;&gt;();
  
      public List&lt;Property&gt; getProperties() {
          return properties;
      }
  }
  </code></pre>
  
  <p>I want a <code>Map&lt;String, Set&lt;Model&gt;&gt;</code> from a <code>List&lt;Model&gt;</code> where the key would be the name from the <code>Property</code> class. How can I can I use java8 streams to group that list by its <code>Propery</code>es' name? All <code>Property</code>es are unique by name. </p>
  
  <p>It is possible to solve in a single stream or should I split it somehow or go for the classical solution? </p>