code: @SuppressWarnings("unchecked")
      public static <T> T getInternalState(Object object, String fieldName) {
          Field foundField = findFieldInHierarchy(object, fieldName);
          try {
              return (T) foundField.get(object);
          } catch (IllegalAccessException e) {
              throw new RuntimeException("Internal error: Failed to get field in method getInternalState.", e);
          }
      }
docs: Get the value of a field using reflection. This method will iterate
  through the entire class hierarchy and return the value of the first
  field named <tt>fieldName</tt>. If you want to get a specific field value
  at specific place in the class hierarchy please refer to
  
  @param <T>       the generic type
  @param object    the object to modify
  @param fieldName the name of the field
  @return the internal state
  {@link #getInternalState(Object, String, Class)}.