code: private static Object getValue(Object obj, String propertyPattern, ObjectWrapper options) {
          if (propertyPattern == null) {
              throw new IllegalArgumentException("Cannot get the value from a property with a 'null' propertyPattern.");
          }
  
          if (obj == null) {
              // NullPointerException as it is throwed only when traversing a null object (ex: "foo.null.bar")
              throw new NullPointerException("Cannot get the value of '" + propertyPattern + "' from a 'null' object.");
          }
  
          // '.' 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());
              Object leftValue = getValue(obj, leftPattern, options);
  
              return getValue(leftValue, rightPattern, options);
              // if (propertyPattern.contains("["))
          } else if (position < 0) {
              int squarePosition = -position;
  
              String leftPattern = propertyPattern.substring(0, squarePosition);
              String indexOrKey = propertyPattern.substring(squarePosition + 1, propertyPattern.length() - 1);// removes ']'
              Property leftProperty = getPropertyOrThrow(Bean.forClass(obj.getClass()), leftPattern);
  
              if (Map.class.isAssignableFrom(leftProperty.getType())) {
                  return getMappedValue(obj, leftProperty, indexOrKey);
              } else {
                  try {
                      return getIndexedValue(obj, leftProperty, Integer.parseInt(indexOrKey), options);
                  } catch (NumberFormatException e) {
                      throw new IllegalArgumentException("The pattern '" + indexOrKey + "' for the indexed "
                                                                 + leftProperty + " is invalid. Cannot parse the string to a valid integer index.");
                  }
              }
          }
  
          return getSimpleValue(obj, getPropertyOrThrow(Bean.forClass(obj.getClass()), propertyPattern));
      }
docs: /*
  Internal static version of {@link ObjectWrapper#getValue(String)}.