public static boolean typeCheck(Class type,Object instance){
  return type.isAssignableFrom(instance.getClass()) || isWrapperInstance(type,instance);
}

public static boolean typeCheck ( Class type , Object instance ) { return type . isAssignableFrom ( instance . getClass ( ) ) || isWrapperInstance ( type , instance ) ; }
check if an object is an instance of a given class , or , if the class is a primitive type , if the object is an instance of the wrapper class for that primitive ( e . g . , as integer is a wrapper for int ) .
