It is possible to have two classes in Java with the same fully qualified class name, if they are loaded by different class loaders. I don't know how practical it would be to take advantage of that, but at least theoretically it would be possible to mock a static method.
There is also the technique suggested by Michael Feathers in "Working Effectively with Legacy Code" whereby you isolate the offending calls in a handful of protected methods. You then subclass the class under test and stub out these methods.
You could "mock" the static method with JMockit. However, the pattern suggested here seems like a much better solution.
For .NET programmers, I've written some code that will generate an assembly with the described interface declaration and forwarding implementation. For more information, refer to the testing library http://jolt.codeplex.com.
The comments you read and contribute here belong only to the person who posted them. We reserve the right to remove off-topic comments.