code: public static Field getDeclaredField(final Class<?> cls, final String fieldName, final boolean forceAccess) {
          Validate.isTrue(cls != null, "The class must not be null");
          Validate.isTrue(StringUtils.isNotBlank(fieldName), "The field name must not be blank/empty");
          try {
              // only consider the specified class by using getDeclaredField()
              final Field field = cls.getDeclaredField(fieldName);
              if (!MemberUtils.isAccessible(field)) {
                  if (forceAccess) {
                      field.setAccessible(true);
                  } else {
                      return null;
                  }
              }
              return field;
          } catch (final NoSuchFieldException e) { // NOPMD
              // ignore
          }
          return null;
      }
docs: Gets an accessible {@link Field} by name, breaking scope if requested. Only the specified class will be
  considered.
  
  @param cls
  the {@link Class} to reflect, must not be {@code null}
  @param fieldName
  the field name to obtain
  @param forceAccess
  whether to break scope restrictions using the
  {@link java.lang.reflect.AccessibleObject#setAccessible(boolean)} method. {@code false} will only
  match {@code public} fields.
  @return the Field object
  @throws IllegalArgumentException
  if the class is {@code null}, or the field name is blank or empty