public Class<?> getCollectionOrArrayType() {
	if (propertyDescriptor.getReadMethod().getReturnType().isArray()) {
	    return propertyDescriptor.getReadMethod().getReturnType()
		    .getComponentType();
	}
	if (!Collection.class.isAssignableFrom(getPropertyType())) {
	    throw new UnsupportedOperationException(
		    propertyDescriptor.getName() + " of "
			    + getClass().getSimpleName()
			    + " is not a Collection property");
	}
	Type type = propertyDescriptor.getReadMethod().getGenericReturnType();
	Type[] typeArgs = getGenericTypeArguments(type);
	if (typeArgs != null && typeArgs.length > 0) {
	    return (Class<?>) typeArgs[0];
	} else {
	    throw new UnsupportedOperationException(
		    propertyDescriptor.getName() + " of "
			    + getClass().getSimpleName()
			    + " is not a parametrized Collection property");
	}
    }