How should this instanceof condition look like?
<p>I have a list of nodes. This nodes are a data class I defined by myself. Each node has a data field of the type Object. Now I want to find the node in a list of nodes that has the parameter object in the data field. I wrote this method, because I wanted to first compare if the two objects (the parameter and the object in the data field) are of the same type:</p>

<pre><code>public Node getnNodeByData(Object obj) {
    for (Node node : nodes) {
        if (node.getData() instanceof obj.getClass()) {

        }
    }
}
</code></pre>

<p>Unfortunately this condition does not work:</p>

<pre><code>Incompatible operand types boolean and Class&lt;capture#1-of ? extends Graph&gt;
</code></pre>

<p>I don't really know why this is a problem. How can I make this working?</p>
