code: @Override
    public boolean add(S solution) {
      boolean solutionInserted = false ;
      if (solutionList.size() == 0) {
        solutionList.add(solution) ;
        solutionInserted = true ;
      } else {
        Iterator<S> iterator = solutionList.iterator();
        boolean isDominated = false;
        
        boolean isContained = false;
        while (((!isDominated) && (!isContained)) && (iterator.hasNext())) {
          S listIndividual = iterator.next();
          int flag = dominanceComparator.compare(solution, listIndividual);
          if (flag == -1) {
            iterator.remove();
          }  else if (flag == 1) {
            isDominated = true; // dominated by one in the list
          } else if (flag == 0) {
            int equalflag = equalSolutions.compare(solution, listIndividual);
            if (equalflag == 0) // solutions are equals
              isContained = true;
          }
        }
        
        if (!isDominated && !isContained) {
      	  solutionList.add(solution);
      	  solutionInserted = true;
        }
        
        return solutionInserted;
      }
  
      return solutionInserted ;
    }
docs: Inserts a solution in the list
  
  @param solution The solution to be inserted.
  @return true if the operation success, and false if the solution is dominated or if an
  identical individual exists. The decision variables can be null if the solution is read from a
  file; in that case, the domination tests are omitted