title: Java optional class method cannot be resolved
body: <p>Given a class <code>Student</code> and its associated method <code>getGrade</code></p>
  
  <pre><code>class Student{
      public int getGrade(int age){
          return age - 6;
      }
  }
  </code></pre>
  
  <p>When I use the Optional class and call the function <code>getGrade</code>, it resulted in a compilation error with invalid method reference.</p>
  
  <pre><code>import java.util.Optional;
  public class Classroom {
      public static void main(String[] args) {
  
          Student s = new Student();
          Optional&lt;Student&gt; optStu = Optional.ofNullable(s);
          System.out.println(optStu.map(optStu::getGrade));
      }
  }
  </code></pre>
  
  <p>What do I need to change in the <code>sout</code> to print the age of the student?</p>