title: Store lambda function in variable?
body: <p>As we know, In java-8 we can store function/method in variable. by using following way. </p>
  
  <pre><code>    @FunctionalInterface
      public interface MyInterface {
  
        public string getValue(int val1, int val2);
  
      }
  
  
      public class MyClass {
  
      static String someFun(int val1, int val2) {
         return ""+(val1+val2)
  
      }
  
       static BiFunction&lt;Integer, Integer, String&gt; testParamFun = (a,b) -&gt; ""+(a+b);
  
      public static void main(String[] args){
  
         MyInterface intr = MyClass::someFun;
         System.out.println(int.getValue(2,4)); // outpur will be "6" 
  
         /* i want this, but it give me compile time error? 
           I want to store that function in variable like i was doing in above case. */
  
     MyInterface inter = MyClass::testParamFun;
     System.out.println(inter.getValue(4,5)); // it gives me error.
     // then i tried this
     System.out.println(inter.apply(4,5)); // i got error again. 
  
  
      }
  
      }
  </code></pre>
  
  <p>My question is, how can I store <code>BiDirection</code> in variable type <code>MyInterface</code></p>