### Question:
TypeUtils { public static Type getErasedType(Type type) { Utils.checkNotNull(type, "type"); Type erasedType; if (type instanceof ParameterizedType) { Type rawType = ((ParameterizedType) type).getRawType(); erasedType = getErasedType(rawType); } else if (isArray(type)) { Type componentType = getComponentType(type); Type erasedComponentType = getErasedType(componentType); erasedType = getArrayType(erasedComponentType); } else if (type instanceof TypeVariable) { Type[] bounds = ((TypeVariable<?>) type).getBounds(); erasedType = getErasedType(bounds[0]); } else { erasedType = type; } return erasedType; } private  TypeUtils(); static boolean isAssignable(Type supertype, Type type); static boolean isInstance(Type type, Object object); static Type getErasedType(Type type); 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 String toString(Type type); static String toString(Type type, ClassSerializer serializer); static String toUnqualifiedString(Type type);  }### Answer:
@Test(expected = NullPointerException.class) public void getErasedTypeWithNull() { TypeUtils.getErasedType(null); }
@Test public void getErasedTypeWithClass() { assertEquals(Integer.class, TypeUtils.getErasedType(Integer.class)); }
@Test public void getErasedTypeWithClassArray() { assertEquals(Integer[].class, TypeUtils.getErasedType(Integer[].class)); }
@Test public void getErasedTypeWithTypeVariable() { assertEquals(Number.class, TypeUtils.getErasedType(Types.typeVariable(declaration, "T", Number.class, Comparable.class))); }
@Test public void getErasedTypeWithGenericArrayType() { assertEquals(List[].class, TypeUtils.getErasedType(valueOf("List<Integer>[]"))); }
@Test public void getErasedTypeWithParameterizedType() { assertEquals(List.class, TypeUtils.getErasedType(valueOf("List<Integer>"))); }
@Test public void getErasedTypeWithWildcardType() { Type type = Types.unboundedWildcardType(); assertEquals(type, TypeUtils.getErasedType(type)); }