My motto for Java is \"just because Java has static blocks, it doesn\'t mean that you should be using them.\" Jokes aside, there are a lot of tricks in Java that make testing a
You can use PowerMock to execute the private method call like:
ClassWithStaticInit staticInitClass = new ClassWithStaticInit() Whitebox.invokeMethod(staticInitClass, "staticInit");