Here you can find the source of isAssignable(Class> lhsType, Class> rhsType)
public static boolean isAssignable(Class<?> lhsType, Class<?> rhsType)
//package com.java2s; //License from project: Apache License import java.util.HashMap; import java.util.Map; public class Main { /**/*from w ww. j a v a 2s . co m*/ * Map with primitive wrapper type as key and corresponding primitive * type as value, for example: Integer.class -> int.class. */ private static final Map<Class<?>, Class<?>> primitiveWrapperTypeMap = new HashMap<Class<?>, Class<?>>(8); public static boolean isAssignable(Class<?> lhsType, Class<?> rhsType) { return (lhsType.isAssignableFrom(rhsType) || lhsType.equals(primitiveWrapperTypeMap.get(rhsType))); } }