UserService mock;@Beforepublic void setUp() throws Exception { mock = EasyMock.mock(UserService.class);}@Testpublic void test() throws Exception { EasyMock.expect(mock.authenticate("username", "password")).andReture(true); EasyMock.replay(mock); // Invoke mock EasyMock.verify(mock);}