### Question:
BaseLoadBalancer implements LoadBalancer { public Map<HRegionInfo, ServerName> immediateAssignment(List<HRegionInfo> regions, List<ServerName> servers) { metricsBalancer.incrMiscInvocations(); Map<HRegionInfo, ServerName> assignments = new TreeMap<HRegionInfo, ServerName>(); for (HRegionInfo region : regions) { assignments.put(region, randomAssignment(region, servers)); } return assignments; }  @Override void setConf(Configuration conf); @Override Configuration getConf(); void setClusterStatus(ClusterStatus st); void setMasterServices(MasterServices masterServices); Map<ServerName, List<HRegionInfo>> roundRobinAssignment(List<HRegionInfo> regions,
      List<ServerName> servers); Map<HRegionInfo, ServerName> immediateAssignment(List<HRegionInfo> regions,
      List<ServerName> servers); ServerName randomAssignment(HRegionInfo regionInfo, List<ServerName> servers); Map<ServerName, List<HRegionInfo>> retainAssignment(Map<HRegionInfo, ServerName> regions,
      List<ServerName> servers); @Override void initialize(); @Override boolean isStopped(); @Override void stop(String why);  }### 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); } }