This article describes how to write unit test cases for Java based on Mockito and supplemented by PowerMock.