public double[] sugarGain() {
        if(this.sugarGain[1]>0) {
            return sugarGain;
        }
		double bestGain = 0.0;
		double bestValue = 0.0;
		for (Tea t : trainingSet) {
			double tmpGain = gainForSugarValue(t.getSugar());
			double tmpValue = t.getSugar();
			if (tmpGain > bestGain) {
				bestGain = tmpGain;
				bestValue = tmpValue;
			}
		}
        sugarGain[0] = bestGain;
        sugarGain[1] = bestValue;;
		return sugarGain;
	}