@Override
  @GuardedBy("getLock()")
  public PageInfo removePage(PageId pageId, boolean isTemporary) throws PageNotFoundException {
    if (!mPages.contains(INDEX_PAGE_ID, pageId)) {
      throw new PageNotFoundException(String.format("Page %s could not be found", pageId));
    }

    PageInfo pageInfo = mPages.getFirstByField(INDEX_PAGE_ID, pageId);
    mPages.remove(pageInfo);
    mBytes.addAndGet(-pageInfo.getPageSize());
    Metrics.SPACE_USED.dec(pageInfo.getPageSize());
    if (isTemporary) {
      pageInfo.getLocalCacheDir().deleteTempPage(pageInfo);
    } else {
      pageInfo.getLocalCacheDir().deletePage(pageInfo);
    }
    return pageInfo;
  }
@Test
  public void removeNotExist() throws Exception {
    assertThrows(PageNotFoundException.class, () -> {
      assertEquals(mPageInfo, mMetaStore.removePage(mPage));
    });
    assertEquals(0, mCachedPageGauge.getValue());
  }