### Question:
DefaultLoadBalancer implements LoadBalancer { public Map<HRegionInfo, ServerName> immediateAssignment( List<HRegionInfo> regions, List<ServerName> servers) { Map<HRegionInfo,ServerName> assignments = new TreeMap<HRegionInfo,ServerName>(); for(HRegionInfo region : regions) { assignments.put(region, servers.get(RANDOM.nextInt(servers.size()))); } return assignments; }  void setClusterStatus(ClusterStatus st); void setMasterServices(MasterServices masterServices); @Override void setConf(Configuration conf); @Override Configuration getConf(); List<RegionPlan> balanceCluster(
      Map<ServerName, List<HRegionInfo>> clusterState); Map<ServerName, List<HRegionInfo>> roundRobinAssignment(
      List<HRegionInfo> regions, List<ServerName> servers); Map<ServerName, List<HRegionInfo>> retainAssignment(
      Map<HRegionInfo, ServerName> regions, List<ServerName> servers); Map<HRegionInfo, ServerName> immediateAssignment(
      List<HRegionInfo> regions, List<ServerName> servers); ServerName randomAssignment(List<ServerName> servers);  }### Answer:
@Test public void testImmediateAssignment() throws Exception { for(int [] mock : regionsAndServersMocks) { LOG.debug("testImmediateAssignment with " + mock[0] + " regions and " + mock[1] + " servers"); List<HRegionInfo> regions = randomRegions(mock[0]); List<ServerAndLoad> servers = randomServers(mock[1], 0); List<ServerName> list = getListOfServerNames(servers); Map<HRegionInfo,ServerName> assignments = loadBalancer.immediateAssignment(regions, list); assertImmediateAssignment(regions, list, assignments); returnRegions(regions); returnServers(list); } }