code: public int compareTo(Object o) {
          ObjectStreamField f = (ObjectStreamField) o;
          boolean thisPrimitive = this.isPrimitive();
          boolean fPrimitive = f.isPrimitive();
  
          // If one is primitive and the other isn't, we have enough info to
          // compare
          if (thisPrimitive != fPrimitive) {
              return thisPrimitive ? -1 : 1;
          }
  
          // Either both primitives or both not primitives. Compare based on name.
          return this.getName().compareTo(f.getName());
      }
docs: Compares this field descriptor to the specified one. Checks first if one
  of the compared fields has a primitive type and the other one not. If so,
  the field with the primitive type is considered to be "smaller". If both
  fields are equal, their names are compared.
  
  @param o
  the object to compare with.
  @return -1 if this field is "smaller" than field {@code o}, 0 if both
  fields are equal; 1 if this field is "greater" than field {@code
  o}.