using Method invoke with static methods?
<p>How do you invoke a static java method when one of the parameters for Method invoke <code>invoke(Object obj, Object[] args)</code>, requires an object parameter?</p>

<p>For example<br>
Here I have a section of code that checks a class and locates any static methods that have no parameters, a return type of Boolean and starts with the name "test".  I am trying to invoke such methods to see if they return true though, and I am at odds at how to do so.</p>

<pre><code>for (int i = 0; i &lt; Class.forName(name).getDeclaredMethods().length; i++) {
    Method method = Class.forName(name).getDeclaredMethods()[i];
    if (method.getParameterTypes().length == 0 
            &amp;&amp; method.getReturnType().getName() == "boolean" 
            &amp;&amp; method.getName().startsWith("test", 0)) {
        if (Class.forName(name).getDeclaredMethods()[i].invoke()==true)
            System.out.println("Test" + " " + Class.forName(name).getDeclaredMethods()[i].getName() + " " + "succeeded");
    }
}
</code></pre>
