public void sortLocatedBlocks(final String targetHost,
      final List<LocatedBlock> locatedBlocks) {
    Comparator<DatanodeInfo> comparator =
        avoidStaleDataNodesForRead || avoidSlowDataNodesForRead ?
        new DFSUtil.StaleAndSlowComparator(
            avoidStaleDataNodesForRead, staleInterval,
            avoidSlowDataNodesForRead, slowNodesUuidSet) :
        new DFSUtil.ServiceComparator();
    // sort located block
    for (LocatedBlock lb : locatedBlocks) {
      if (lb.isStriped()) {
        sortLocatedStripedBlock(lb, comparator);
      } else {
        sortLocatedBlock(lb, targetHost, comparator);
      }
    }
  }
@Test
  public void testSortLocatedBlocks() throws IOException, URISyntaxException {
    HelperFunction(null, 0);
  }