Find a class instance by given field object
<p>Is it possible to find a object instance using a public static method which expects a field object as parameter? </p>

<p>Thats what I search:</p>

<pre><code>public class Foo {
    private Bar myObject;

    public static Foo get(Bar bar) {
        // return an instance of Foo which has stored a
        // reference to bar inside myObject or null if not found
    }
}
</code></pre>

<p>I hope, you understand my concern. Google did not help, I just guess that there could be a solution using Java Reflection. Thanks a lot for help.</p>
