public class UriFragmentManagerTest extends TestCase {
public void testGetSetUriFragment() {
Page page = EasyMock.createMock(Page.class);
UriFragmentManager manager = new UriFragmentManager(page);
// prepare mock
EasyMock.expect(page.getUriFragment()).andReturn("");
page.setUriFragment("!test", false);
EasyMock.expect(page.getUriFragment()).andReturn("!test");
EasyMock.replay(page);
// test manager using the mock
assertEquals("Incorrect fragment value", "", manager.getState());
manager.setState("test");
assertEquals("Incorrect fragment value", "test", manager.getState());
}