### Question:
TypeUtils { public static boolean isInstance(Type type, Object object) { return getErasedReferenceType(type).isInstance(object); } private  TypeUtils(); static boolean isAssignable(Type supertype, Type type); static boolean isInstance(Type type, Object object); static Type getErasedType(Type type); static Class<?> getErasedReferenceType(Type type); @Deprecated static Class<?> getRawType(Type type); static boolean isArray(Type type); static Type getComponentType(Type type); static Type getArrayType(Type componentType); static boolean isSimpleParameterizedType(Type type, Class<?> rawType); static Type getActualTypeArgument(Type type); static Type getResolvedSuperclass(Type type); static Type[] getResolvedInterfaces(Type type); static String toString(Type type); static String toString(Type type, ClassSerializer serializer); static String toUnqualifiedString(Type type); static String toSimpleString(Type type);  }### Answer:
@Test(expected = NullPointerException.class) public void isInstanceWithNullType() { TypeUtils.isInstance(null, Integer.valueOf(123)); }
@Test public void isInstanceWithClass() { assertTrue(TypeUtils.isInstance(Integer.class, 123)); }
@Test public void isInstanceWithClassAndSubclass() { assertTrue(TypeUtils.isInstance(Number.class, 123)); }
@Test public void isInstanceWithClassAndSuperclass() { assertFalse(TypeUtils.isInstance(Number.class, new Object())); }
@Test public void isInstanceWithClassAndDisjointClass() { assertFalse(TypeUtils.isInstance(Integer.class, 123L)); }
@Test public void isInstanceWithClassAndNull() { assertFalse(TypeUtils.isInstance(Integer.class, null)); }
@Test public void isInstanceWithClassArray() { assertTrue(TypeUtils.isInstance(Integer[].class, new Integer[0])); }
@Test public void isInstanceWithClassArrayAndSubclassArray() { assertTrue(TypeUtils.isInstance(Number[].class, new Integer[0])); }
@Test public void isInstanceWithClassArrayAndSuperclassArray() { assertFalse(TypeUtils.isInstance(Number[].class, new Object[0])); }
@Test public void isInstanceWithClassArrayAndDisjointClass() { assertFalse(TypeUtils.isInstance(Integer[].class, new Long[0])); }
@Test public void isInstanceWithGenericArrayType() { assertTrue(TypeUtils.isInstance(valueOf("List<Integer>[]"), new List[0])); }
@Test public void isInstanceWithGenericArrayTypeAndSubclassComponentType() { assertTrue(TypeUtils.isInstance(valueOf("Collection<Integer>[]"), new List[0])); }
@Test public void isInstanceWithGenericArrayTypeAndSuperclassComponentType() { assertFalse(TypeUtils.isInstance(valueOf("List<Integer>[]"), new Collection[0])); }
@Test public void isInstanceWithGenericArrayTypeWithDisjointComponentType() { assertFalse(TypeUtils.isInstance(valueOf("List<Integer>[]"), new Set[0])); }
@Test public void isInstanceWithParameterizedType() { assertTrue(TypeUtils.isInstance(valueOf("ArrayList<Integer>"), new ArrayList<Integer>())); }
@Test public void isInstanceWithParameterizedTypeWithSubclassRawType() { assertTrue(TypeUtils.isInstance(valueOf("Collection<Integer>"), new ArrayList<Integer>())); }
@Test public void isInstanceWithParameterizedTypeWithSuperclassRawType() { assertFalse(TypeUtils.isInstance(valueOf("LinkedHashSet<Integer>"), new HashSet<Integer>())); }
@Test public void isInstanceWithParameterizedTypeWithDisjointRawType() { assertFalse(TypeUtils.isInstance(valueOf("List<Integer>"), new HashSet<Integer>())); }
@Test public void isInstanceWithParameterizedTypeWithDisjointTypeArgument() { assertTrue(TypeUtils.isInstance(valueOf("ArrayList<Integer>"), new ArrayList<Long>())); }