code: private static String formatMean(Double mean) {
      if (mean == null) {
        // Handle nulls separately, else the %.2f format below will
        // truncate 'null' to 'nu'.
        return null;
      }
      return String.format("%.2f", mean);
    }
docs: Returns a formatted version of {@code mean}, handling nulls.