code: public static Property getProperty(Bean bean, String propertyPattern) {
          if (propertyPattern == null) {
              throw new IllegalArgumentException("Cannot get a property with a 'null' propertyPattern.");
          }
  
          // '.' position if positive, '[' inverse position if negative
          int position = indexOfDotOrSquare(propertyPattern);
  
          // (propertyPattern.contains("."))
          if (position > 0) {
              String leftPattern = propertyPattern.substring(0, position);
              String rightPattern = propertyPattern.substring(position + 1, propertyPattern.length());
              Property leftProperty = bean.getProperty(leftPattern);
  
              return (leftProperty != null) ? getProperty(Bean.forClass(leftProperty.getType()), rightPattern) : null;
              // if (propertyPattern.contains("["))
          } else if (position < 0) {
              throw new IllegalArgumentException("The indexed or mapped '[]' notation is not allowed while searching" +
                                                         " a property, but '" + propertyPattern + "' pattern found.");
          }
  
          return bean.getProperty(propertyPattern);
      }
docs: /*
  Internal static version of {@link #getProperty(String)}.