code: public Method[] getAllMethods(Object o) {
      Method[] methods = o.getClass().getDeclaredMethods();
      AccessibleObject.setAccessible(methods, true);
      return methods;
    }
docs: Returns all declared Methods on Object o as accessible.
  
  @param o Object to access
  @return all declared Methods on Object o as accessible