title: Java 8 Deferring Execution of Method
body: <p>I have a class hierarchy like this:</p>
  
  <pre><code>public abstract class AbstractFoo {
      abstractMethod(/*parameters*/) {
          //do something;
      }
  }
  
  public class Foo extends AbstractFoo {
      public String doSomething(int id, int value, FooB b, FooC c) {
          //do something;
      }
  
      public void doSomethingElse() {
          abstractMethod(param1, param2);
      }
  }
  </code></pre>
  
  <p>I want to be able to pass the <code>doSomething</code> method as a method parameter to <code>abstractMethod</code>. I tried something like this:</p>
  
  <pre><code>public abstract class AbstractFoo {
      abstractMethod(/*parameters*/, Callable&lt;String&gt; method) {
          //do something;
          method.call();
      }
  }
  
  public class Foo extends AbstractFoo {
      Callable&lt;String&gt; doSomething = (int id, int value, FooB b, FooC c) -&gt; {
          //do something;
      };
  
      public void doSomethingElse() {
          abstractMethod(param1, param2, doSomething);
      }
  }
  </code></pre>
  
  <p>But I'm getting the following error:</p>
  
  <pre><code>Error:(37, 40) java: incompatible types: incompatible parameter types in lambda expression: wrong number of parameters: expected 0 but found 4
  </code></pre>
  
  <p>So clearly I'm not doing this correctly. What exactly is the proper Java 8 way to achieve what I want?</p>
  
  <p><strong>Edit 1:</strong> Based on comments, here is an attempt at a better solution:</p>
  
  <pre><code>@FunctionalInterface
  public interface Fazz&lt;T&gt; {
      String createStuff(int id, int value, T value1, T value2);
  }
  
  public abstract class AbstractFoo {
      abstractMethod(Fazz&lt;T&gt; interfc) {
          interfc.createStuff(/* pass parameters? */);
      }
  }
  
  public class Foo extends AbstractFoo {
      Fazz&lt;String&gt; doSomething = (int id, int value, String value1, String value2) -&gt; {
          //do something;
      };
  
      public void doSomethingElse() {
          abstractMethod(doSomething);
      }
  }
  </code></pre>