private Admin mockAdmin(RegionMetrics... regionLoadArray) throws Exception {
    Admin mockAdmin = Mockito.mock(Admin.class);
    List<RegionMetrics> regionLoads = new ArrayList<>(Arrays.asList(regionLoadArray));
    when(mockAdmin.getConfiguration()).thenReturn(configuration);
    when(mockAdmin.getRegionMetrics(sn, TableName.valueOf("sizeTestTable")))
      .thenReturn(regionLoads);
    return mockAdmin;
  }
Creates mock returning RegionLoad info about given servers.
hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestRegionSizeCalculator.java