PageAccessSynchronizer synchronizer = new PageAccessSynchronizer(Duration.seconds(2));
IPageManager pageManager = new MockPageManager();
IPageManager synchronizedPageManager = synchronizer.adapt(pageManager);
synchronizedPageManager.getPage(0);
ConcurrentMap<Integer, PageLock> locks = synchronizer.getLocks().get();
PageLock pageLock = locks.get(Integer.valueOf(0));
assertNull(pageLock);
int pageId = 1;
IManageablePage page = new MockPage(pageId);
synchronizedPageManager.touchPage(page);
synchronizedPageManager.getPage(pageId);
PageLock pageLock2 = locks.get(Integer.valueOf(pageId));
assertNotNull(pageLock2);
}