Is there an equvilant to C++ member function pointers in Java?
<p>Before you mark as a dup, yes I've seen <a href="http://stackoverflow.com/questions/1073358/function-pointers-in-java">Function Pointers in Java</a>, and no, it didn't really answer my question, basically because I'm pretty new to Java, so I didn't really understand allot of the answers.</p>

<p>This is kind of some mashed up Java / C++,  is there any reasonable way to do this in Java?</p>

<pre><code>public class Foo {
    private int _data;

    /* various other functions */    

    public boolean test1( Foo other ) {  /* do test */ }
    public boolean test2( Foo other ) {  /* do test */ }
    public boolean test3( Foo other ) {  /* do test */ }
    public boolean test4( Foo other ) {  /* do test */ }
}

public class Bar {
    private Foo[] _foos = { /* Init an array of Foos */ };

    public Bar doSomething() {
        _foos = new Foo[4];

        _foos[0] = getTest(Foo::test1);
        _foos[1] = getTest(Foo::test2);
        _foos[2] = getTest(Foo::test3);
        _foos[3] = getTest(Foo::test4);
    }

    /* 
     * Now we only have a single function which takes function pointer.
     */
    private Foo _getTest(boolean Foo::*func()) {
        Foo current = _foos[ 0 ];

        for ( int i = 1; i != _foos.length; i++ )
            current = current.*func( _foos[ i ] ) ? _foos[ i ] : current;

        return current;
    }
}
</code></pre>
