private void initializeNameGoals(Map<TestCase,Set<TestFitnessFunction>> testToGoals){
  for (  Map.Entry<TestCase,Set<TestFitnessFunction>> entry : testToGoals.entrySet()) {
    Set<TestFitnessFunction> goals=new LinkedHashSet<>();
    List<TestFitnessFunction> topGoals=getTopGoals(entry.getValue());
    if (topGoals.isEmpty()) {
    }
 else     if (topGoals.size() <= MAX_SIMILAR_GOALS) {
      for (      TestFitnessFunction goal : topGoals) {
        goals.add(goal);
        String goalName=getTestName(entry.getKey(),goals);
        if (goalName.length() > MAX_CHARS) {
          goals.remove(goal);
          break;
        }
      }
    }
 else {
      goals.add(chooseRepresentativeGoal(entry.getKey(),topGoals));
    }
    testToGoals.put(entry.getKey(),goals);
  }
}

private void initializeNameGoals ( Map < TestCase , Set < TestFitnessFunction > > testToGoals ) { for ( Map . Entry < TestCase , Set < TestFitnessFunction > > entry : testToGoals . entrySet ( ) ) { Set < TestFitnessFunction > goals = new LinkedHashSet < > ( ) ; List < TestFitnessFunction > topGoals = getTopGoals ( entry . getValue ( ) ) ; if ( topGoals . isEmpty ( ) ) { } else if ( topGoals . size ( ) <= MAX_SIMILAR_GOALS ) { for ( TestFitnessFunction goal : topGoals ) { goals . add ( goal ) ; String goalName = getTestName ( entry . getKey ( ) , goals ) ; if ( goalName . length ( ) > MAX_CHARS ) { goals . remove ( goal ) ; break ; } } } else { goals . add ( chooseRepresentativeGoal ( entry . getKey ( ) , topGoals ) ) ; } testToGoals . put ( entry . getKey ( ) , goals ) ; } }
initially , set to the top level goals
