public static boolean isTypeConvertible(Class srcType, Class destType) {
    // handle null: if srcType is null, then it represents
    // a null runtime value, and for our purposes it is type
    // convertible to any type that is assignable from Object.class
    if (srcType == null) {
      // TODO: This should always be true as Object is assignable from everything, is the root type
      // of all Java classes. Object.class is always assignable from every other Java class.
      return isAssignableFrom(destType, Object.class);
    }

    // check to see if the classes are assignable
    if (isAssignableFrom(srcType, destType)) {
      return true;
    }

    // handle booleans: are we going from a wrapper Boolean
    // to a primitive boolean or vice-versa?
    if ((srcType == Boolean.TYPE || srcType == Boolean.class)
        && (destType == Boolean.TYPE || destType == Boolean.class)) {
      return true;
    }

    // a numeric primitive or wrapper can be converted to
    // the same wrapper or a same or wider primitive.
    // handle chars specially
    int i = _numericPrimitiveClasses.indexOf(srcType);
    if (i < 0) {
      i = _numericWrapperClasses.indexOf(srcType);
    }

    int destP = _numericPrimitiveClasses.indexOf(destType);
    int destW = -1;
    if (destP < 0) {
      destW = _numericWrapperClasses.indexOf(destType);
    }

    // same size wrapper
    if (i >= 0 && destW == i) {
      return true;
    }

    // same or wider primitive
    if (i >= 0 && destP >= i) {
      return true;
    }

    // chars
    if (srcType == Character.class || srcType == Character.TYPE) {
      // chars: same size wrapper/primitive
      return destType == Character.class || destType == Character.TYPE;
    }

    // no other possibilities
    return false;
  }
Determines if the Class represented by the first parameter can be safely converted to the Class
represented by the second parameter.

@param srcType the source class to be converted.
@param destType the target class to be converted to.
@return the {@code boolean} value indicating whether objects of the type {@code srcType} can be
        converted to objects of type {@code destType} .
geode-core/src/main/java/org/apache/geode/cache/query/internal/types/TypeUtils.java