@Override
  public int compare(S solution1, S solution2) {
    int result = rankComparator.compare(solution1, solution2) ;
    if (result == 0) {
      result = crowdingDistanceComparator.compare(solution1, solution2);
    }

    return result;
  }
@ Override public int compare ( S solution1 , S solution2 ) { int result = rankComparator . compare ( solution1 , solution2 ) ; if ( result == 0 ) { result = crowdingDistanceComparator . compare ( solution1 , solution2 ) ; } return result ; }
Compares two solutions.

@param solution1 Object representing the first solution
@param solution2 Object representing the second solution.
@return -1, or 0, or 1 if solution1 is less than, equal, or greater than solution2,
respectively.