### Question:
SessionQuotaManagingDataStore extends DelegatingPageStore { @Override public void removePage(IPageContext context, IManageablePage page) { if (page instanceof SerializedPage == false) { throw new WicketRuntimeException("SessionQuotaDataStore works with serialized pages only"); } SerializedPage serializedPage = (SerializedPage)page; SessionData sessionData = getSessionData(context, false); if (sessionData != null) { sessionData.removePage(context, getDelegate(), serializedPage); } } SessionQuotaManagingDataStore(IPageStore delegate, int maxPages);  SessionQuotaManagingDataStore(IPageStore delegate, Bytes maxBytes);   SessionQuotaManagingDataStore(IPageStore delegate, Supplier<SessionData> dataCreator); @Override boolean canBeAsynchronous(IPageContext context); @Override void removeAllPages(IPageContext context); @Override void addPage(IPageContext context, IManageablePage page); @Override void removePage(IPageContext context, IManageablePage page);  }### Answer:
@Test public void removePage() { MockPageStore delegate = new MockPageStore(); IPageContext context = new MockPageContext(); IPageStore quotaStore = new SessionQuotaManagingDataStore(delegate, Bytes.bytes(page1.getData().length + page3.getData().length)); quotaStore.addPage(context, page1); quotaStore.addPage(context, page2); quotaStore.removePage(context, page2); quotaStore.addPage(context, page3); assertEquals(2, delegate.getPages().size()); assertEquals(page1, delegate.getPages().get(0)); assertEquals(page3, delegate.getPages().get(1)); }