PowerMock is no longer maintained and is only compatible with Mockito 3. However, modern Mockito supports mocking static methods, so PowerMock is no longer needed (after adjusting the tests a bit).