code: private static Object evaluate(Object target, String expression) {
          try {
              if (target instanceof List) {
  
                  List<?> list = (List<?>) target;
  
                  int index = Integer.parseInt(expression);
                  if (index < 0) {
                      index += list.size();
                  }
  
                  return list.get(index);
  
              } else {
  
                  Method getter = findAccessor(target, expression);
                  if (getter == null) {
                      return null;
                  }
  
                  return getter.invoke(target);
  
              }
          } catch (IllegalAccessException exception) {
              throw new IllegalStateException("BOOM", exception);
  
          } catch (InvocationTargetException exception) {
              if (exception.getCause() instanceof RuntimeException) {
                  throw (RuntimeException) exception.getCause();
              }
              throw new RuntimeException("BOOM", exception);
          }
      }
docs: Uses reflection to evaluate a single element of a path expression on
  the given object. If the object is a list and the expression is a
  number, this returns the expression'th element of the list. Otherwise,
  this looks for a method named "get${expression}" and returns the result
  of calling it.
  
  @param target the object to evaluate the expression against
  @param expression the expression to evaluate
  @return the result of evaluating the expression