json-path/src/main/java/io/restassured/path/json/JsonPath.java
public <T> List<T> getList(String path, Class<T> genericType) {
        if (genericType == null) {
            throw new IllegalArgumentException("Generic type cannot be null");
        }
        final List<T> original = get(path);
        final List<T> newList = new LinkedList<T>();
        if (original != null) {
            for (T t : original) {
                T e;
                if (t instanceof Map && !genericType.isAssignableFrom(Map.class)) {
                    // TODO Avoid double parsing
                    String str = objectToString(t);
                    //noinspection unchecked
                    e = (T) jsonStringToObject(str, genericType);
                } else {
                    e = ObjectConverter.convertObjectTo(t, genericType);
                }
                newList.add(e);
            }
        }
        return Collections.unmodifiableList(newList);
    }
public <T> List<T> getList(String path, Class<T> genericType) {
        if (genericType == null) {
            throw new IllegalArgumentException("Generic type cannot be null");
        }
        final List<T> original = get(path);
        final List<T> newList = new LinkedList<T>();
        if (original != null) {
            for (T t : original) {
                T e;
                if (t instanceof Map && !genericType.isAssignableFrom(Map.class)) {
                    // TODO Avoid double parsing
                    String str = objectToString(t);
                    //noinspection unchecked
                    e = (T) jsonStringToObject(str, genericType);
                } else {
                    e = ObjectConverter.convertObjectTo(t, genericType);
                }
                newList.add(e);
            }
        }
        return Collections.unmodifiableList(newList);
    }
public < T > List < T > getList ( String path , Class < T > genericType ) { if ( genericType == null ) { throw new IllegalArgumentException ( "Generic type cannot be null" ) ; } final List < T > original = get ( path ) ; final List < T > newList = new LinkedList < T > ( ) ; if ( original != null ) { for ( T t : original ) { T e ; if ( t instanceof Map && ! genericType . isAssignableFrom ( Map . class ) ) { // TODO Avoid double parsing String str = objectToString ( t ) ; //noinspection unchecked e = ( T ) jsonStringToObject ( str , genericType ) ; } else { e = ObjectConverter . convertObjectTo ( t , genericType ) ; } newList . add ( e ) ; } } return Collections . unmodifiableList ( newList ) ; }
Get the result of an Object path expression as a list.

@param path        The Object path.
@param genericType The generic list type
@param <T>         The type
@return The object matching the Object path. A {@link java.lang.ClassCastException} will be thrown if the object
cannot be casted to the expected type.
Get the result of an Object path expression as a list .