IMocksControl control = EasyMock.createControl();
NavigationStateManager manager = control
.createMock(NavigationStateManager.class);
ViewDisplay display = control.createMock(ViewDisplay.class);
ViewProvider provider = control.createMock(ViewProvider.class);
View view1 = control.createMock(View.class);
View view2 = control.createMock(View.class);
// prepare mocks: what to expect
manager.setNavigator(EasyMock.anyObject(Navigator.class));
EasyMock.expect(provider.getViewName("test1")).andReturn("test1");
EasyMock.expect(provider.getView("test1")).andReturn(view1);
EasyMock.expect(manager.getState()).andReturn("");
view1.enter(eventParametersEqual(""));
display.showView(view1);
manager.setState("test1");
EasyMock.expect(manager.getState()).andReturn("test1");
EasyMock.expect(provider.getViewName("test2/")).andReturn("test2");
EasyMock.expect(provider.getView("test2")).andReturn(view2);
EasyMock.expect(manager.getState()).andReturn("test1");
view2.enter(eventParametersEqual(""));
display.showView(view2);
manager.setState("test2");
EasyMock.expect(manager.getState()).andReturn("test2");
EasyMock.expect(provider.getViewName("test1/params"))