docs: public static boolean isAssignable(Class<?> cls, final Class<?> toClass, final boolean autoboxing) {
          if (toClass == null) {
              return false;
          }
          // have to check for null, as isAssignableFrom doesn't
          if (cls == null) {
              return !toClass.isPrimitive();
          }
          //autoboxing:
          if (autoboxing) {
              if (cls.isPrimitive() && !toClass.isPrimitive()) {
                  cls = primitiveToWrapper(cls);
                  if (cls == null) {
                      return false;
                  }
              }
              if (toClass.isPrimitive() && !cls.isPrimitive()) {
                  cls = wrapperToPrimitive(cls);
                  if (cls == null) {
                      return false;
                  }
              }
          }
          if (cls.equals(toClass)) {
              return true;
          }
          if (cls.isPrimitive()) {
              if (!toClass.isPrimitive()) {
                  return false;
              }
              if (Integer.TYPE.equals(cls)) {
                  return Long.TYPE.equals(toClass)
                      || Float.TYPE.equals(toClass)
                      || Double.TYPE.equals(toClass);
              }
              if (Long.TYPE.equals(cls)) {
                  return Float.TYPE.equals(toClass)
                      || Double.TYPE.equals(toClass);
              }
              if (Boolean.TYPE.equals(cls)) {
                  return false;
              }
              if (Double.TYPE.equals(cls)) {
                  return false;
              }
              if (Float.TYPE.equals(cls)) {
                  return Double.TYPE.equals(toClass);
              }
              if (Character.TYPE.equals(cls)) {
                  return Integer.TYPE.equals(toClass)
                      || Long.TYPE.equals(toClass)
                      || Float.TYPE.equals(toClass)
                      || Double.TYPE.equals(toClass);
              }
              if (Short.TYPE.equals(cls)) {
                  return Integer.TYPE.equals(toClass)
                      || Long.TYPE.equals(toClass)
                      || Float.TYPE.equals(toClass)
                      || Double.TYPE.equals(toClass);
              }
              if (Byte.TYPE.equals(cls)) {
                  return Short.TYPE.equals(toClass)
                      || Integer.TYPE.equals(toClass)
                      || Long.TYPE.equals(toClass)
                      || Float.TYPE.equals(toClass)
                      || Double.TYPE.equals(toClass);
              }
              // should never get here
              return false;
          }
          return toClass.isAssignableFrom(cls);
      }