EasyMock, like other JUnit mock testers, allows you to set expectations for method calls on the mocked object.  However, the expect() method wants to see a return type from the method call.  So, what to do?

A built-in mechanism of EasyMocks is to just “call” the void method in question.  For example a commonly mocked object is the HttpSession:

    expect(request.getSession()).andReturn(session);
    expect(session.getAttribute(name)).andReturn(null);
    session.setAttribute(eq(name), isA(InSession.class));
    replay(session);
    //whatever you are really trying to test
    verify(session);

Could only be easier if the doc told you this clearly.