code: public static <S extends Solution<?>> double distanceBetweenObjectives(S firstSolution, S secondSolution) {
  
      double diff;
      double distance = 0.0;
  
      //euclidean distance
      for (int nObj = 0; nObj < firstSolution.getNumberOfObjectives(); nObj++) {
        diff = firstSolution.getObjective(nObj) - secondSolution.getObjective(nObj);
        distance += Math.pow(diff, 2.0);
      }
  
      return Math.sqrt(distance);
    }
docs: Returns the euclidean distance between a pair of solutions in the objective space