code: @SuppressWarnings({"unchecked", "rawtypes"})
      public static Field getField(Class<?> type, String fieldName) {
          LinkedList<Class<?>> examine = new LinkedList<Class<?>>();
          examine.add(type);
          Set<Class<?>> done = new HashSet<Class<?>>();
          while (!examine.isEmpty()) {
              Class<?> thisType = examine.removeFirst();
              done.add(thisType);
              final Field[] declaredField = thisType.getDeclaredFields();
              for (Field field : declaredField) {
                  if (fieldName.equals(field.getName())) {
                      field.setAccessible(true);
                      return field;
                  }
              }
              Set<Class<?>> potential = new HashSet<Class<?>>();
              final Class<?> clazz = thisType.getSuperclass();
              if (clazz != null) {
                  potential.add(thisType.getSuperclass());
              }
              potential.addAll((Collection) Arrays.asList(thisType.getInterfaces()));
              potential.removeAll(done);
              examine.addAll(potential);
          }
  
          throwExceptionIfFieldWasNotFound(type, fieldName, null);
          return null;
      }
docs: Convenience method to get a field from a class type.
  
  The method will first try to look for a declared field in the same class.
  If the method is not declared in this class it will look for the field in
  the super class. This will continue throughout the whole class hierarchy.
  If the field is not found an {@link IllegalArgumentException} is thrown.
  
  @param type      The type of the class where the method is located.
  @param fieldName The method names.
  @return A .