code: public Type getCompatibleType(Type other) {
          if (other == null) {
              return null;
          }
  
          if (equals(other)) {
              if (this == NULL_TYPE) {
                  return other;
              }
              else {
                  return this;
              }
          }
  
          Class<?> classA = mObjectClass;
          Class<?> classB = other.mObjectClass;
  
          Type compat;
  
          if (classA == Void.class) {
              if (classB == Void.class) {
                  compat = this;
              }
              else {
                  return null;
              }
          }
          else if (classB == Void.class) {
              return null;
          }
          else if (other == NULL_TYPE) {
              compat = this.toNullable();
          }
          else if (this == NULL_TYPE) {
              compat = other.toNullable();
          }
          else if (Number.class.isAssignableFrom(classA) &&
              Number.class.isAssignableFrom(classB)) {
  
              Class<?> clazz = compatibleNumber(classA, classB);
              if (isPrimitive() && other.isPrimitive()) {
                  compat = new Type(clazz, convertToPrimitive(clazz));
              }
              else {
                  compat = new Type(clazz);
              }
          }
          else {
              // TODO: ensure generics are matched
              // ie: List<Number> and List<Integer> = List<Number>
              compat = new Type(findCommonBaseClass(classA, classB));
          }
  
          if (isNonNull() && other.isNonNull()) {
              compat = compat.toNonNull();
          }
  
          return compat;
      }
docs: Returns a type that is compatible with this type, and the one passed in.
  The type returned is selected using a best-fit algorithm.
  
  <p>If the type passed in represents a primitive type, but this type is
  not, the type returned is an object (or a subclass of), but never a
  primitive type. Compatible primitive types are returned when both this
  and the parameter type were already primitive types.
  
  <p>Input types which are arrays are also supported by this method.
  
  <p>Returns null if the given type isn't compatible with this one.