### Question:
ReflectionUtils { public MapType getMapGenericType(final Type fieldType, final String declaringClass, final String fieldName) { final Class<?> fieldClass = getArgumentTypeClass(fieldType, declaringClass, fieldName, false); final String cacheKey = "MapGenericFieldType-" + fieldClass.getName() + '-' + fieldName; return CACHE_MANAGER.getFromCache(cacheKey, MapType.class).orElseGet(() -> { if (!Map.class.isAssignableFrom(fieldClass)) { throw new IllegalArgumentException("Type for object: " + fieldName + " is invalid. " + "It cannot be assigned from: " + Map.class.getName() + "."); } MapElemType keyType, elemType; if (ParameterizedType.class.isAssignableFrom(fieldType.getClass())) { final ParameterizedType genericType = (ParameterizedType) fieldType; keyType = getMapElemType(genericType.getActualTypeArguments()[0], declaringClass, fieldName); elemType = getMapElemType(genericType.getActualTypeArguments()[1], declaringClass, fieldName); } else { keyType = buildItemType(fieldType, declaringClass, fieldName); elemType = buildItemType(fieldType, declaringClass, fieldName); } final MapType mapType = new MapType(keyType, elemType); CACHE_MANAGER.cacheObject(cacheKey, mapType); return mapType; }); }  Object invokeMethod(final Method method, final Object target, final Object... args); boolean isSetter(final Method method); boolean isGetter(final Method method); Object getFieldValue(final Object target, final Field field); @SuppressWarnings("unchecked") Object getFieldValue(final Object target, final String fieldName, final Class<?> fieldType); A getFieldAnnotation(final Field field, final Class<A> annotationClazz); A getParameterAnnotation(final Parameter parameter, final Class<A> annotationClazz, final String declaringClassName); Field getDeclaredField(final String fieldName, final Class<?> targetClass); Class<?> getDeclaredFieldType(final String fieldName, final Class<?> clazz); void setFieldValue(final Object target, final String fieldName, final Object fieldValue); void setFieldValue(final Object target, final Field field, final Object fieldValue); Method getSetterMethodForField(final Class<?> fieldClass, final String fieldName, final Class<?> fieldType); Class<?> getGenericFieldType(final Field field); MapType getMapGenericType(final Type fieldType, final String declaringClass, final String fieldName); Class<?> getArgumentTypeClass(final Object argument, final String declaringClass, final String fieldName, final boolean getNestedGenericClass); Class<?> getArrayType(final Field arrayField);  }### Answer:
@Test(expectedExceptions = IllegalArgumentException.class) public void testGetMapGenericTypeThrowsIllegalArgumentExceptionWhenTheGivenTypeIsNotAMap() { underTest.getMapGenericType(List.class, null, LIST_FIELD_NAME); }