@Override
 public int compare(Dimension dim1, Dimension dim2) {
   int result = nullCompare(dim1, dim2);
   if (result == NON_NULLS) {
     result = nullSafeCompare(dim1.getName(), dim2.getName());
     if (result == 0) {
       return nullSafeCompare(dim1.getValue(), dim2.getValue());
     }
   }
   return result;
 }
 /**
  * Passes into {@link #addDimension(String, String, boolean)}
  *
  * @return this for chaining
  * @throws MetricsNameSyntaxException on validation failure
  */
 public MetricNameBuilder addDimension(Dimension dimension, boolean permute)
     throws MetricsNameSyntaxException {
   return addDimension(dimension.getName(), dimension.getValue(), false);
 }