TypeUtil { public static boolean isInstanceOf(Class<?> clazz, Object object) { return clazz.isInstance(object); }  static int computeCharacterConversion(Class<?> parent, Class<?> child, List<TypeConverter> converters); static int computeDistance(Class<?> parent, Class<?> child); static int computeNumericConversion(Class<?> parent, Class<?> child, List<TypeConverter> converters); static Class<?> forName(String fqn); static Class<?> forName(String fqn, JVMView view); static Class<?> getClass(String simpleName, JVMView view); static int getCost(Class<?> parent, Class<?> child); static String getName(String name, boolean shortName); static List<String> getNames(Class<?>[] classes); static String getPackage(String name); static int getPoint(Class<?> clazz); static boolean isBoolean(Class<?> clazz); static boolean isByte(Class<?> clazz); static boolean isCharacter(Class<?> clazz); static boolean isDouble(Class<?> clazz); static boolean isFloat(Class<?> clazz); static boolean isInteger(Class<?> clazz); static boolean isLong(Class<?> clazz); static boolean isNumeric(Class<?> clazz); static boolean isShort(Class<?> clazz); static boolean isInstanceOf(Class<?> clazz, Object object); static boolean isInstanceOf(String classFQN, Object object); final static int DISTANCE_FACTOR; }
@Test public void testIsInstance() { Object object = new ZTest(); assertTrue(TypeUtil.isInstanceOf(I0Test.class, object)); assertTrue(TypeUtil.isInstanceOf("py4j.reflection.I0Test", object)); object = new ATest(); assertFalse(TypeUtil.isInstanceOf(I0Test.class, object)); assertFalse(TypeUtil.isInstanceOf("py4j.reflection.I0Test", object)); }