@Test
public void testOnResetChanges() throws Exception {

    final FBFormItem formItem = EasyMock.createMock(FBFormItem.class);
    final Map<String, Object> newProps = new HashMap<String, Object>();
    UndoableHandler handler = EasyMock.createMock(UndoableHandler.class);
    handler.onEvent(EasyMock.isA(UndoableEvent.class));
    EasyMock.expectLastCall().andAnswer(new IAnswer<Object>() {
        public Object answer() throws Throwable {
            Object[] params = EasyMock.getCurrentArguments();
            UndoableEvent event = (UndoableEvent) params[0];
            assertNotNull("newItems shouldn't be null", event.getData("newItems"));
            assertNotNull("fakeItemSelected shouldn't be null", event.getData("fakeItemSelected"));
            assertSame("newProps and newItems should be the same", newProps, event.getData("newItems"));
            assertSame("formItem and fakeItemSelected should be the same", formItem, event.getData("itemSelected"));
            return null;
        }
    }).once();
    bus.addHandler(UndoableEvent.TYPE, handler);
    view.populate(EasyMock.same(formItem));
    EasyMock.expectLastCall().once();
    EasyMock.replay(view, formItem);
    EditionPresenter presenter = new EditionPresenter(view);
    presenter.onResetChanges(formItem, newProps);
    EasyMock.verify(view, formItem);
}