code: private void standardize(double[] values) {
          double mean = calculateMean(values);
          double stdDev = calculateStandardDeviation(values, mean);
  
          /*
           * If standard deviation is 0, all values of the metric are
           * identical. Return vector of 0s.
           */
          if (stdDev == 0.0) {
              for (int i = 0; i < values.length; i++) {
                  values[i] = 0.0;
              }
              return;
          };
  
          for (int i = 0; i < values.length; i++) {
              double standardizedValue = (values[i] - mean) / stdDev;
              values[i] = standardizedValue;
          }
      }
docs: /*
  Standardizes the values to have zero mean and unit variance.
  Formula: standardizedValue = (rawValue - mean) / standardDeviation