Mockito compared to EasyMock seems to be more easily and has more flexibility. First it's able to mock up interfaces as well as classes. You doesn't need additional Jar libraries. Furthermore there isn't any replay mode. First you have to stub and afterwards you have to verificate your mocked classes or interfaces. Further examples and advantages could be read here. Have a look at the following example:
1. Add the Mockito dependency to your pom.xml:
org.mockito mockito-all 1.8.4 test
2. Mockito in JUnit test:
@Test
import static org.mockito.Mockito.*;
//...
@Test
public void testMockito() {
Map mapMock = mock(Map.class);
when(mapMock.get("firstKey")).thenReturn("firstValue");
when(mapMock.get("secondKey")).thenReturn("secondValue");
Object o = new Object();
mapMock.put("anyObject", o);
assertEquals("firstValue", mapMock.get("firstKey"));
assertEquals("secondValue", mapMock.get("secondKey"));
verify(mapMock).get("firstKey");
verify(mapMock).get("secondKey");
verify(mapMock).put("anyObject", o);
}
Regards
Rafael Sobek

Mockito Example
Mockito Example (tags: mockito