### Question:
ReflectionHelper { public static Type getIndexedType(Type type) { Type indexedType = null; if ( isIterable( type ) && type instanceof ParameterizedType ) { ParameterizedType paramType = ( ParameterizedType ) type; indexedType = paramType.getActualTypeArguments()[0]; } else if ( isMap( type ) && type instanceof ParameterizedType ) { ParameterizedType paramType = ( ParameterizedType ) type; indexedType = paramType.getActualTypeArguments()[1]; } else if ( TypeUtils.isArray( type ) ) { indexedType = TypeUtils.getComponentType( type ); } return indexedType; } private  ReflectionHelper(); @SuppressWarnings("unchecked") static T getAnnotationParameter(Annotation annotation, String parameterName, Class<T> type); static String getPropertyName(Member member); static Class<?> getType(Member member); static Class<?> getAnnotations(Member member); static Type typeOf(Member member); static Object getValue(Member member, Object object); static void setAccessibility(Member member); static Class<?> loadClass(String name, Class<?> caller); static Type getIndexedType(Type type); static boolean isIterable(Type type); static boolean isMap(Type type); static Object getIndexedValue(Object value, String index); static boolean containsMember(Class<?> clazz, String property); static boolean containsField(Class<?> clazz, String fieldName); static Field getField(Class<?> clazz, String fieldName); static boolean containsMethod(Class<?> clazz, String methodName); static Method getMethod(Class<?> clazz, String methodName); static Class<?> classForName(String name, Class<?> caller);  }### Answer:
@Test public void testGetIndexedType() throws Exception { Type type = TestTypes.class.getField( "stringList" ).getGenericType(); assertEquals( String.class, ReflectionHelper.getIndexedType( type ) ); type = TestTypes.class.getField( "objectMap" ).getGenericType(); assertEquals( Object.class, ReflectionHelper.getIndexedType( type ) ); type = TestTypes.class.getField( "stringArray" ).getGenericType(); assertEquals( String.class, ReflectionHelper.getIndexedType( type ) ); }