code: public void evaluate(DoubleSolution solution) {
      double[] f = new double[getNumberOfObjectives()];
  
      double g = this.evalG(solution);
      f[0] = (1 + g) * solution.getVariableValue(0);
      f[1] = (1 + g) * (1- Math.sqrt(solution.getVariableValue(0)) * 
      		Math.pow(Math.cos(solution.getVariableValue(0) * Math.PI * 2), 2));
  
      solution.setObjective(0, f[0]);
      solution.setObjective(1, f[1]);
    }
docs: Evaluate() method