code: public int compare(Class toType_a, Class toType_b) {
          TypeDesc from = mFrom;
          TypeDesc a = TypeDesc.forClass(toType_a);
          TypeDesc b = TypeDesc.forClass(toType_b);
  
          if (from == a) {
              if (from == b) {
                  return 0;
              }
              return -1;
          } else if (from == b) {
              return 1;
          }
  
          int result = compare(from, a, b);
          if (result != 0) {
              return result;
          }
  
          if (from.isPrimitive()) {
              // Try boxing.
              if (from.toObjectType() != null) {
                  from = from.toObjectType();
                  return compare(from, a, b);
              }
          } else {
              // Try unboxing.
              if (from.toPrimitiveType() != null) {
                  from = from.toPrimitiveType();
                  result = compare(from, a, b);
                  if (result != 0) {
                      return result;
                  }
                  // Try boxing back up. Test by unboxing 'to' types.
                  if (!toType_a.isPrimitive() && a.toPrimitiveType() != null) {
                      a = a.toPrimitiveType();
                  }
                  if (!toType_b.isPrimitive() && b.toPrimitiveType() != null) {
                      b = b.toPrimitiveType();
                  }
                  return compare(from, a, b);
              }
          }
  
          return 0;
      }
docs: Evaluates two types, to see which one is nearest to the from type.
  Return {@literal <0} if "a" is nearest, 0 if both are equally good,
  {@literal >0} if "b" is nearest.