public void cleanup() throws IOException {
    for (PartitionId partitionId : partitions.values()) {
      MockPartitionId mockPartition = (MockPartitionId) partitionId;
      mockPartition.cleanUp();
    }

    for (DataNodeId dataNode : dataNodes) {
      List<String> mountPaths = ((MockDataNodeId) dataNode).getMountPaths();
      for (String mountPath : mountPaths) {
        File mountPathDir = new File(mountPath);
        deleteFileOrDirectory(mountPathDir);
      }
    }
  }
Set the registry as {@code toSet} ensure that this is the one that is returned by {@link #getMetricRegistry()}
@param toSet the metric registry to set to.
ambry-test-utils/src/main/java/com/github/ambry/clustermap/MockClusterMap.java