DefaultRoundStrategy implements RoundStrategy { @Override public boolean isFinished(KeywordCollection currentPopulation) { if (maxNumberOfSteps != null && currentStep >= maxNumberOfSteps) { return true; } if (minImprovementBetweenSteps != null && lastAvgScore != null) { double currentAvgScore = currentPopulation.getAverageScore(); double improvement = (currentAvgScore - lastAvgScore) / lastAvgScore; if (improvement < minImprovementBetweenSteps) { return true; } } return false; } DefaultRoundStrategy(@Nullable Integer maxNrSteps, @Nullable Double minImprovement,
      int maxPopulationSize, int replicateBestCount);  DefaultRoundStrategy(OptimizationContext context); @Override KeywordCollection nextRound(KeywordCollection currentPopulation,
      AlternativesFinder alternativesFinder, Evaluator evaluator); @Override boolean isFinished(KeywordCollection currentPopulation);  }
@Test public void testEmptyFinished() { DefaultRoundStrategy strategy = new DefaultRoundStrategy( MAXIMUM_STEPS, MINIMUM_IMPROVEMENT, MAXIMUM_POPULATION_SIZE, MAXIMUM_ALTERNATIVES); KeywordCollection collection = new KeywordCollection(CampaignConfiguration.builder().build()); assertFalse(strategy.isFinished(collection)); }