public void sortAttributes(Comparator<? super Attribute> comparator) {
    if (attributes != null) {
      attributes.sort(comparator);
    }
  }
public void sortAttributes(Comparator<? super Attribute> comparator)