goja-core/src/main/java/goja/core/kits/reflect/ClassKit.java
public static boolean isAssignable(Class<?> lhsType, Class<?> rhsType) {
        Preconditions.checkNotNull(lhsType, "Left-hand side type must not be null");
        Preconditions.checkNotNull(rhsType, "Right-hand side type must not be null");
        if (lhsType.isAssignableFrom(rhsType)) {
            return true;
        }
        if (lhsType.isPrimitive()) {
            Class<?> resolvedPrimitive = primitiveWrapperTypeMap.get(rhsType);
            if (resolvedPrimitive != null && lhsType.equals(resolvedPrimitive)) {
                return true;
            }
        } else {
            Class<?> resolvedWrapper = primitiveTypeToWrapperMap.get(rhsType);
            if (resolvedWrapper != null && lhsType.isAssignableFrom(resolvedWrapper)) {
                return true;
            }
        }
        return false;
    }
public static boolean isAssignable(Class<?> lhsType, Class<?> rhsType) {
        Preconditions.checkNotNull(lhsType, "Left-hand side type must not be null");
        Preconditions.checkNotNull(rhsType, "Right-hand side type must not be null");
        if (lhsType.isAssignableFrom(rhsType)) {
            return true;
        }
        if (lhsType.isPrimitive()) {
            Class<?> resolvedPrimitive = primitiveWrapperTypeMap.get(rhsType);
            if (resolvedPrimitive != null && lhsType.equals(resolvedPrimitive)) {
                return true;
            }
        } else {
            Class<?> resolvedWrapper = primitiveTypeToWrapperMap.get(rhsType);
            if (resolvedWrapper != null && lhsType.isAssignableFrom(resolvedWrapper)) {
                return true;
            }
        }
        return false;
    }
public static boolean isAssignable ( Class < ? > lhsType , Class < ? > rhsType ) { Preconditions . checkNotNull ( lhsType , "Left-hand side type must not be null" ) ; Preconditions . checkNotNull ( rhsType , "Right-hand side type must not be null" ) ; if ( lhsType . isAssignableFrom ( rhsType ) ) { return true ; } if ( lhsType . isPrimitive ( ) ) { Class < ? > resolvedPrimitive = primitiveWrapperTypeMap . get ( rhsType ) ; if ( resolvedPrimitive != null && lhsType . equals ( resolvedPrimitive ) ) { return true ; } } else { Class < ? > resolvedWrapper = primitiveTypeToWrapperMap . get ( rhsType ) ; if ( resolvedWrapper != null && lhsType . isAssignableFrom ( resolvedWrapper ) ) { return true ; } } return false ; }
Check if the right-hand side type may be assigned to the left-hand side
type, assuming setting by reflection. Considers primitive wrapper
classes as assignable to the corresponding primitive types.

@param lhsType the target type
@param rhsType the value type that should be assigned to the target type
@return if the target type is assignable from the value type
Check if the right - hand side type may be assigned to the left - hand side type assuming setting by reflection . Considers primitive wrapper classes as assignable to the corresponding primitive types .