Java method reference
<p>I've some class with these methods:</p>

<pre><code>public class TestClass
{

    public void method1()
    {
        // this method will be used for consuming MyClass1
    }

    public void method2()
    {
        // this method will be used for consuming MyClass2
    }
}
</code></pre>

<p>and classes:</p>

<pre><code>public class MyClass1
{
}

public class MyClass2
{
}
</code></pre>

<p>and I want <code>HashMap&lt;Class&lt;?&gt;, "question"&gt;</code> where I would store (key: class, value: method) pairs like this ( class "type" is associated with method )</p>

<pre><code>hashmp.add(Myclass1.class, "question");
</code></pre>

<p>and I want to know how to add method references to HashMap (replace "question").</p>

<p>p.s. I've come from C# where I simply write <code>Dictionary&lt;Type, Action&gt;</code> :)</p>
