### Question:
TypeLiterals { @SuppressWarnings("unchecked") public static <K, V> TypeLiteral<Map<K, V>> mapOf(Class<K> keyType, Class<V> valueType) { return (TypeLiteral<Map<K, V>>)TypeLiteral.get(Types.mapOf(keyType, valueType)); } private  TypeLiterals(); @SuppressWarnings("unchecked") static TypeLiteral<List<T>> listOf(Class<T> type); @SuppressWarnings("unchecked") static TypeLiteral<List<T>> listOf(TypeLiteral<T> type); @SuppressWarnings("unchecked") static TypeLiteral<Set<T>> setOf(Class<T> type); @SuppressWarnings("unchecked") static TypeLiteral<Set<T>> setOf(TypeLiteral<T> type); @SuppressWarnings("unchecked") static TypeLiteral<Map<K, V>> mapOf(Class<K> keyType, Class<V> valueType); @SuppressWarnings("unchecked") static TypeLiteral<Map<K, V>> mapOf(Class<K> keyType, TypeLiteral<V> valueType); @SuppressWarnings("unchecked") static TypeLiteral<Map<K, V>> mapOf(TypeLiteral<K> keyType, Class<V> valueType); @SuppressWarnings("unchecked") static TypeLiteral<Map<K, V>> mapOf(TypeLiteral<K> keyType, TypeLiteral<V> valueType); @SuppressWarnings("unchecked") static TypeLiteral<Provider<T>> providerOf(Class<T> type); @SuppressWarnings("unchecked") static TypeLiteral<Provider<T>> providerOf(TypeLiteral<T> type);  }### Answer:
@Test public void testMapOf() { assertThat(TypeLiterals.mapOf(String.class, String.class), equalTo(new TypeLiteral<Map<String, String>>() { })); assertThat(TypeLiterals.mapOf(String.class, new TypeLiteral<Class<?>>() { }), equalTo(new TypeLiteral<Map<String, Class<?>>>() { })); assertThat(TypeLiterals.mapOf(new TypeLiteral<Class<?>>() { }, String.class), equalTo(new TypeLiteral<Map<Class<?>, String>>() { })); assertThat(TypeLiterals.mapOf(new TypeLiteral<Class<?>>() { }, new TypeLiteral<Class<?>>() { }), equalTo(new TypeLiteral<Map<Class<?>, Class<?>>>() { })); }