code: public Field[] getAllFields(Object o) {
      Field[] fields = o.getClass().getDeclaredFields();
      AccessibleObject.setAccessible(fields, true);
      return fields;
    }
docs: Returns all declared Fields on Object o as accessible.
  
  @param o Object to access
  @return all declared Fields on Object o as accessible