call static method on parameter without instantiating class in argument
<p>I've really been getting into TDD and I've started using mockito in jUnit to improve my ability to test code.  I'm really loving mockito!</p>

<p>I've noticed that I have to change the way I think about coding, like passing collaborators as much as possible into methods and limiting work done in constructors wherever possible.</p>

<p>The following scenario warranted some advice from the experts here on SO.</p>

<p>Say I have a method, that's going to call some static methods on a certain class. E.G.</p>

<pre><code>public void method(){
    OtherClass.staticMethod();
}
</code></pre>

<p>This is generally bad, but it's needed in my scenario.  To make the code more testable in my unit tests I'd like to avoid the dependency on OtherClass and pass it as an argument.</p>

<p>This doesn't work as it yields a compile time error.</p>

<pre><code>public void method(Class&lt;? extends OtherClass&gt; util){
    util.staticMethod();
}
...
method(OtherClass.class);
</code></pre>

<p>This would work, but I don't like the instantiating OtherClass if I don't have to, as it's solely a class of static utility like methods:</p>

<pre><code>public void method(OtherClass util){
     util.staticMethod();
}
...
method(new OtherClass());
</code></pre>

<p>My question to you:
Is there a better more preferable way to accomplish this without using the new keyword?</p>
