code: public static Field getField(Class<?> type, String fieldName) {
  
      try {
        return type.getDeclaredField(fieldName);
      }
      catch (NoSuchFieldException cause) {
  
        if (type.getSuperclass() != null) {
          return getField(type.getSuperclass(), fieldName);
        }
  
        throw new FieldNotFoundException(cause);
      }
    }
docs: Gets a Field object representing the named field on the specified class.  This method will recursively search
  up the class hierarchy of the specified class until the Object class is reached.  If the named field is found
  then a Field object representing the class field is returned, otherwise a NoSuchFieldException is thrown.
  
  @param type the Class type to search for the specified field.
  @param fieldName a String indicating the name of the field on the class.
  @return a Field object representing the named field on the specified class.
  @throws FieldNotFoundException if the named field does not exist on the specified class
  or a superclass of the specified class.
  @see java.lang.Class
  @see java.lang.Class#getDeclaredField(String)
  @see java.lang.reflect.Field