@Override
        public Class<?> validate(Class<?> parent, String property, Class<?> propertyType) {
            while (!parent.equals(Object.class)) {
                try {
                    Field field = parent.getDeclaredField(property);
                    if (Map.class.isAssignableFrom(field.getType())) {
                        return (Class) ReflectionUtils.getTypeParameterAsClass(field.getGenericType(), 1);
                    } else if (Collection.class.isAssignableFrom(field.getType())) {
                        return (Class) ReflectionUtils.getTypeParameterAsClass(field.getGenericType(), 0);
                    } else {
                        return (Class) PrimitiveUtils.wrap(field.getType());
                    }
                } catch (NoSuchFieldException e) {
                    parent = parent.getSuperclass();
                }
            }
            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