public interface IPersonMapper {
    public void insert(Person person);
}
public class MockIPersonMapper implements IPersonMapper {
    private ExpectationCounter myInsertCalls = new ExpectationCounter("com.sap.mock.IPersonMapper InsertCalls");
    private ReturnValues myActualInsertReturnValues = new VoidReturnValues(false);
    private ExpectationList myInsertParameter0Values = new ExpectationList("com.sap.mock.IPersonMapper com.sap.mock.Person");
    public void setExpectedInsertCalls(int calls){
        myInsertCalls.setExpected(calls);
    }
    public void addExpectedInsertValues(Person arg0){
        myInsertParameter0Values.addExpected(arg0);
    }
    public void insert(Person arg0){
        myInsertCalls.inc();
        myInsertParameter0Values.addActual(arg0);
        Object nextReturnValue = myActualInsertReturnValues.getNext();
        if (nextReturnValue instanceof ExceptionalReturnValue && ((ExceptionalReturnValue)nextReturnValue).getException() instanceof RuntimeException)
            throw (RuntimeException)((ExceptionalReturnValue)nextReturnValue).getException();
    }
    public void setupExceptionInsert(Throwable arg){
        myActualInsertReturnValues.add(new ExceptionalReturnValue(arg));
    }
    public void verify(){
        myInsertCalls.verify();
        myInsertParameter0Values.verify();
    }
}
In the test code you need to create an instance of the mock class, set the expectations, execute the code which is to be tested, and finally to validate the mock object.
public void test...() {
    Person person = ....;
    IPersonMapper mockPersonMapper = (IPersonMapper)EasyMock.createMock(IPersonMapper.class);
    EasyMock.expect(mockPersonMapper.insert(person));
    EasyMock.replay(mockPersonMapper);
    //... invoke the code to be tested
}