source: class SmartHostSelectionStrategyTest {
  
      private static final Host HOST_1;
      private static final Host HOST_2;
      private static final Host HOST_3;
      private static final Region REGION_1;
      private static final Region REGION_2;
      private static final HubSummary SUMMARY_1;
      private static final HubSummary SUMMARY_2;
      private SmartHostSelectionStrategy strategy;
  
      @Test
      public void testSelectRegion() {
  
target:         strategy.updateHubSummaries(singletonList(SUMMARY_2), currentTimeMillis());
  
          List<Region> allRegions = asList(REGION_1, REGION_2).stream().map(Region::copy).collect(toList());
          List<Region> unvisitedRegions = new ArrayList<>(allRegions);
  
          Region actual = strategy.selectRegion(allRegions, unvisitedRegions);
          assertThat(actual, is(equalTo(allRegions.get(1))));
  
          unvisitedRegions.remove(1);
          actual = strategy.selectRegion(allRegions, unvisitedRegions);
          assertThat(actual, is(equalTo(allRegions.get(1))));
  
          allRegions.get(1).getHosts().clear();
          actual = strategy.selectRegion(allRegions, unvisitedRegions);
          assertThat(actual, is(equalTo(allRegions.get(0))));
      }
  
  }