title: Generic functional interface
body: <p>I'm facing with some lambda problem.<br>
  I'm trying to use lambda expression and functional interface to create method accepting functional interface and some arguments and execute that function.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>@FunctionalInterface
  interface TwoArgumentFunction {
      public &lt;T, K, V&gt; T doJob(K arg1, V arg2);
  } //I know I've ommited return value in that case
  
  
  class SomeClass {
  &lt;T, K, V&gt; T runLongAction(TwoArgumentFunction action, K arg1, V arg2){
      SwingWorker&lt;T, Void&gt; worker = new SwingWorker&lt;T, Void&gt;(){
  
          @Override
          protected T doInBackground() throws Exception {
              {... some code ... }
              return action.doJob(arg1, arg2);
          }
          @Override
          protected void done(){
              {... some code ... }
          }
  
      };
      worker.execute();
      try {
          return worker.get();
      } catch (InterruptedException | ExecutionException e) {
          {... some code ... }
      }
  }
  
  
  void mainInvoke(ArgType1 arg1, ArgType2 arg2){
      runLongAction((arg1, arg2) -&gt; doSomething(arg1, arg2), arg1, arg2);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I've got error: </p>
  
  <blockquote>
    <p>The method runLongAction(( arg1,  arg2) -> {}, ArgType1, ArgType2) is undefined for the type SomeClass</p>
  </blockquote>
  
  <p>I even tried cast lambda to TwoArgumentFunction but then I've got:</p>
  
  <blockquote>
    <p>Illegal lambda expression: Method doJob of type TwoArgumentFunction is generic</p>
  </blockquote>
  
  <p>Anonymouse class instead of lambda expression works fine and that's the simplest workaround I found.</p>