Mock java.lang.Runtime with PowerMockito
My bad in the comments, apologies, I had an inner class for the test and that's why I had no trouble. I then realized this and saw your @PrepareForTest(Runtime.class)
which should read @PrepareForTest(MyClass.class)
(replace MyClass with whatever name you have) because Runtime
is a system class. You can read more about this here and find more examples here.