code: @SuppressWarnings("unchecked")
      public static <T, Q> T getPropertyValue(Q bean, String propertyName, Class<T> propertyType) {
  
          Assert.notNull(bean, "bean");
          Assert.notNull(propertyName, "propertyName");
  
          final PropertyAccessor propertyAccessor = PropertyAccessorFactory.forDirectFieldAccess(bean);
  
          try {
              Assert.isAssignable(propertyType, propertyAccessor.getPropertyType(propertyName));
          } catch (InvalidPropertyException e) {
              throw new IllegalStateException("Invalid property \"" + propertyName + "\"", e);
          }
  
          return (T) propertyAccessor.getPropertyValue(propertyName);
      }
docs: Gets the value of a given property into a given bean.
  
  @param <T>
  the property type.
  @param <Q>
  the bean type.
  @param bean
  the bean itself.
  @param propertyName
  the property name.
  @param propertyType
  the property type.
  @return the property value.
  
  @see PropertyAccessorFactory