code: public static Field getKnownField(Class<?> type, String name) throws NoSuchFieldException {
          NoSuchFieldException last = null;
          do {
              try {
                  Field field = type.getDeclaredField(name);
                  field.setAccessible(true);
                  return field;
              } catch (NoSuchFieldException x) {
                  last = x;
                  type = type.getSuperclass();
              }
          } while (type != null);
          throw last;
      }
docs: Returns a known field by name from the given class disregarding its access control setting, looking through
  all super classes if needed.
  
  @param type the class to start with
  @param name the name of the field
  @return a Field object representing the known field
  @throws NoSuchFieldException if the field is not found