title: Java 8 pass method as parameter
body: <p>Currently getting into Java 8 lambda expressions and method references.</p>
  
  <p>I want to pass a method with no args and no return value as argument to another method. This is how I am doing it:</p>
  
  <pre><code>public void one() {
      System.out.println("one()");
  }
  
  public void pass() {
      run(this::one);
  }
  
  public void run(final Function function) {
      function.call();
  }
  
  @FunctionalInterface
  interface Function {
      void call();
  }
  </code></pre>
  
  <p>I know there is a set of predefined functional interfaces in <a href="http://docs.oracle.com/javase/8/docs/api/java/util/function/package-summary.html"><code>java.util.function</code></a> such as <code>Function&lt;T,R&gt;</code> but I didn't find one with no arguments and not producing a result.</p>