code: public int compareTo(Object o)
     {
        MBeanData md = (MBeanData) o;
        String d1 = objectName.getDomain();
        String d2 = md.objectName.getDomain();
        int compare = d1.compareTo(d2);
        if (compare == 0)
        {
           String p1 = objectName.getCanonicalKeyPropertyListString();
           String p2 = md.objectName.getCanonicalKeyPropertyListString();
           compare = p1.compareTo(p2);
        }
        return compare;
     }
docs: Compares MBeanData based on the ObjectName domain name and canonical
  key properties
  
  @param o the MBeanData to compare against
  @return < 0 if this is less than o, > 0 if this is greater than o,
  0 if equal.