I believe powermock allows you to make fun of statistics as detailed here
I also had this problem in the past, and I was able to create code around it, so I can use JMock, making the method not static, but having a static class reference.
for instance
public ClassToMock { public static final ClassToMock INSTANCE = new ClassToMock(); private ClasstToMock() {}; public void newNonStaticMethod1(){} }
instead
public ClassToMock { public ClasstToMock() {}; public void static origStaticMethod1(){} }
Now your method call will be
ClassToMock.INSTANCE.newNonStaticMethod1();
since newNonStaticMethod1 () is not static, you can now mock it.
Since CalssToMock ctor is private, access to it is possible only through a static instance.
source share