title: Java, return method as reference
body: <p>Im beginner JAVA developer. Here is a method:</p>
  
  <pre><code>private Method getSomething()
  {
      for (Method m : getClass().getDeclaredMethods())
      {
          return m;
      }
      return notFound;
  }
  
  private void notFound()
  {
      throw new Exception();
  }
  </code></pre>
  
  <p>it doesnt matter what it does - if it finds something, then returns a <code>Method</code> - if not, the <code>notFound()</code> method itself should be returned. So the hot spot is at the <code>return notFound;</code> line: if I use <code>return notFound();</code> then it returns its value, not the method itself. I want something like a reference/pointer. So <code>getSomething()</code> returns something what can be called, and if the returned method is used wrong, it should trigger that Exception - so its not an option to replace <code>return notFound;</code> with <code>throw new Exception();</code> !
  Or the 2nd option is to create a lambda method....</p>