@Override
        public Class<?> validate(Class<?> parent, String property, Class<?> propertyType) {
            Method getter = BeanUtils.getAccessor("get", property, parent);
            if (getter == null && PrimitiveUtils.wrap(propertyType).equals(Boolean.class)) {
                getter = BeanUtils.getAccessor("is", property, parent);
            }
            if (getter != null) {
                if (Map.class.isAssignableFrom(getter.getReturnType())) {
                    return (Class) ReflectionUtils.getTypeParameterAsClass(getter.getGenericReturnType(), 1);
                } else if (Collection.class.isAssignableFrom(getter.getReturnType())) {
                    return (Class) ReflectionUtils.getTypeParameterAsClass(getter.getGenericReturnType(), 0);
                } else {
                    return (Class) PrimitiveUtils.wrap(getter.getReturnType());
                }
            } else {
                return null;
            }
        }
Validates the given property of given class

@param parent type of the parent object
@param property property name
@param propertyType property type
@return propertyType or subtype of it
querydsl-core/src/main/java/com/querydsl/core/types/dsl/PathBuilderValidator.java