code: private static Set<Method> collectMethods(Class clazz)
      {
          if (clazz == null) return Collections.emptySet();
  
          Set<Method> s = new HashSet<Method>();
  
          s.addAll(Arrays.asList(clazz.getDeclaredMethods()));
          s.addAll(collectMethods(clazz.getSuperclass()));
  
          return s;
      }
docs: Recursively collect the set of declared methods of a class and
  its super class.
  
  @param clazz the class whose methods to collect
  @return the set of declared methods of a class