### Question:
Types { public static ParameterizedType parameterizedType(Class<?> rawType, Type... actualTypeArguments) { return new DefaultParameterizedType(null, rawType, actualTypeArguments); } private  Types(); static TypeVariable<D> typeVariable(D declaration, String name,
		Type... bounds); static GenericArrayType genericArrayType(Type componentType); static ParameterizedType parameterizedType(Class<?> rawType, Type... actualTypeArguments); static WildcardType unboundedWildcardType(); static WildcardType upperBoundedWildcardType(Type upperBound); static WildcardType lowerBoundedWildcardType(Type lowerBound); static Type valueOf(String typeName); static Type valueOf(String typeName, Set<String> imports);  }### Answer:
@Test public void parameterizedType() { ParameterizedType type = Types.parameterizedType(Map.class, new Type[] {String.class, Integer.class}); assertNotNull(type); assertEquals(Map.class, type.getRawType()); assertNull(type.getOwnerType()); assertArrayEquals(new Type[] {String.class, Integer.class}, type.getActualTypeArguments()); assertEquals(type, stringIntegerMapType); assertEquals(stringIntegerMapType, type); }
@Test(expected = NullPointerException.class) public void parameterizedTypeWithNullRawType() { try { Types.parameterizedType(null, String.class, Integer.class); } catch (NullPointerException exception) { assertEquals("rawType cannot be null", exception.getMessage()); throw exception; } }
@Test public void parameterizedTypeWithNoActualTypeArguments() { ParameterizedType type = Types.parameterizedType(Integer.class); assertNotNull(type); assertEquals(Integer.class, type.getRawType()); assertNull(type.getOwnerType()); assertArrayEquals(new Type[0], type.getActualTypeArguments()); }
@Test(expected = MalformedParameterizedTypeException.class) public void parameterizedTypeWithMismatchedActualTypeArguments() { Types.parameterizedType(Map.class, String.class); }