title: Static context cannot access non-static in Collectors
body: <p>I have group of students. First I want to group them by the marks. Then I want to further group those sets into same name students together.</p>
  
  <pre><code>Map&lt;Integer,Map&lt;String,List&lt;String&gt;&gt;&gt; groupping = students.stream()
                                                      .collect(Collectors.groupingBy(Student::getMarks, 
                                                              Collectors.mapping(Student::getName,Collectors.toList())));
  </code></pre>
  
  <p>I am getting an error saying, </p>
  
  <blockquote>
    <p>Non-static method cannot be refered from a static context.</p>
  </blockquote>
  
  <p>Yes. I am pretty much aware that I cannot refer to a non-static method without having an instance. But with all these stream operations, I'm a bit confused about what has gone wrong really. </p>
  
  <p>Rather than how to fix this; I really want to know what's going on here. Any of your inputs is appreciated!</p>
  
  <p>Because If I write the below grouping is completely valid;</p>
  
  <pre><code>Map&lt;Integer,List&lt;Student&gt;&gt; m = students.stream().
          collect(Collectors.groupingBy(Student::getMarks));
  </code></pre>
  
  <p>Here is my Student.java class <em>(In case if you need it)</em></p>
  
  <pre><code>public class Student {
      private String name;
      private int marks;
      // getters, setters, constructor and toString
  }
  </code></pre>