passing function as arguments from one class to another
<p>I have a class called HelloWorld where I create an object of Class Test test = new Test();</p>

<p>then in the HelloWorld Class I have my main function and another:</p>

<pre><code>public static int passMe(){
    System.out.println("running this function");
    return 1;
}
</code></pre>

<p>this is function im trying to pass. I pass it int test using the following:</p>

<pre><code>test.getSomeFunction(new Callable&lt;Integer&gt;(){
              public Integer call(){
                  return passMe();
              }
          });
</code></pre>

<p>inside Test class I have:</p>

<pre><code>    public void getSomeFunction(Callable&lt;Integer&gt; someFunction){
        System.out.println(someFunction);
    }
</code></pre>

<p>now all this works, but passMe() isn't being run, rather I don't know how to reference it.
if I print out someFunction, I get: </p>

<pre><code>"HelloWorld$1@35a8767"
</code></pre>

<p>so my question is how do I go about running the function I got passed in, if I do someFunction() I get error message "he method someFunction() is undefined for the type Test"</p>
