src/test/java/ucar/geoapi/ContentVerifier.java
private static Class<?> boundOfParameterizedProperty(Type type) {
        if (type instanceof ParameterizedType) {
            Type[] p = ((ParameterizedType) type).getActualTypeArguments();
            if (p != null && p.length == 2) {
                final Type raw = ((ParameterizedType) type).getRawType();
                if (raw instanceof Class<?> && Map.class.isAssignableFrom((Class<?>) raw)) {
                    /*
                     * If the type is a map, keep only the first type parameter (for keys type).
                     * The type that we retain here must be consistent with the choice of iterator
                     * (keys or values) done in above addPropertyValue(…) method.
                     */
                    p = Arrays.copyOf(p, 1);
                }
            }
            while (p != null && p.length == 1) {
                type = p[0];
                if (type instanceof WildcardType) {
                    p = ((WildcardType) type).getUpperBounds();
                } else {
                    if (type instanceof ParameterizedType) {
                        type = ((ParameterizedType) type).getRawType();
                    }
                    if (type instanceof Class<?>) {
                        return (Class<?>) type;
                    }
                    break;                              // Unknown type.
                }
            }
        }
        throw new IllegalArgumentException("Can not find the parameterized type of " + type);
    }
/**
     * Returns the upper bounds of the parameterized type. For example if a method returns {@code Collection<String>},
     * then {@code boundOfParameterizedProperty(method.getGenericReturnType())} should return {@code String.class}.
     */
Returns the upper bounds of the parameterized type. For example if a method returns  Collection,
then  boundOfParameterizedProperty(method.getGenericReturnType()) should return  String.class.
Returns the upper bounds of the parameterized type . For example if a method returns Collection then boundOfParameterizedProperty ( method . getGenericReturnType () ) should return String . class .
private static Class<?> boundOfParameterizedProperty(Type type) {
        if (type instanceof ParameterizedType) {
            Type[] p = ((ParameterizedType) type).getActualTypeArguments();
            if (p != null && p.length == 2) {
                final Type raw = ((ParameterizedType) type).getRawType();
                if (raw instanceof Class<?> && Map.class.isAssignableFrom((Class<?>) raw)) {
                    /*
                     * If the type is a map, keep only the first type parameter (for keys type).
                     * The type that we retain here must be consistent with the choice of iterator
                     * (keys or values) done in above addPropertyValue(…) method.
                     */
                    p = Arrays.copyOf(p, 1);
                }
            }
            while (p != null && p.length == 1) {
                type = p[0];
                if (type instanceof WildcardType) {
                    p = ((WildcardType) type).getUpperBounds();
                } else {
                    if (type instanceof ParameterizedType) {
                        type = ((ParameterizedType) type).getRawType();
                    }
                    if (type instanceof Class<?>) {
                        return (Class<?>) type;
                    }
                    break;                              
                }
            }
        }
        throw new IllegalArgumentException("Can not find the parameterized type of " + type);
    }
private static Class < ? > boundOfParameterizedProperty ( Type type ) { if ( type instanceof ParameterizedType ) { Type [ ] p = ( ( ParameterizedType ) type ) . getActualTypeArguments ( ) ; if ( p != null && p . length == 2 ) { final Type raw = ( ( ParameterizedType ) type ) . getRawType ( ) ; if ( raw instanceof Class < ? > && Map . class . isAssignableFrom ( ( Class < ? > ) raw ) ) { /*
                     * If the type is a map, keep only the first type parameter (for keys type).
                     * The type that we retain here must be consistent with the choice of iterator
                     * (keys or values) done in above addPropertyValue(…) method.
                     */ p = Arrays . copyOf ( p , 1 ) ; } } while ( p != null && p . length == 1 ) { type = p [ 0 ] ; if ( type instanceof WildcardType ) { p = ( ( WildcardType ) type ) . getUpperBounds ( ) ; } else { if ( type instanceof ParameterizedType ) { type = ( ( ParameterizedType ) type ) . getRawType ( ) ; } if ( type instanceof Class < ? > ) { return ( Class < ? > ) type ; } break ; } } } throw new IllegalArgumentException ( "Can not find the parameterized type of " + type ) ; }
Returns the upper bounds of the parameterized type.
Returns the upper bounds of the parameterized type .
// Unknown type.