@Override
  public PageStoreDir allocate(String fileId, long fileLength) {
    return mDirs.get(
        Math.floorMod(mHashFunction.apply(fileId),
            mDirs.size()));
  }
@Test
  public void hashDistributionTest() {
    mAllocator = new HashAllocator(mDirs);
    Map<Path, Integer> result = new HashMap<>();
    int numFiles = 1_000_0;
    for (int i = 0; i < numFiles; i++) {
      PageStoreDir dir = mAllocator.allocate(String.valueOf(i), 0);
      result.put(dir.getRootPath(), result.getOrDefault(dir.getRootPath(), 0) + 1);
    }
    assertTrue(result.values().stream()
        .allMatch(count -> count >= numFiles / mDirs.size() * 0.8
            && count <= numFiles / mDirs.size() * 1.2));
  }