code: private static <T, R> R getMethods(EnhancedAnnotatedType<T> type, MethodListBuilder<T, R> builder) {
          Collection<EnhancedAnnotatedMethod<?, ? super T>> methods = filterMethods(builder.getAllMethods(type));
          for (Class<? super T> clazz = type.getJavaClass(); clazz != null && clazz != Object.class; clazz = clazz.getSuperclass()) {
              builder.levelStart(clazz);
              for (EnhancedAnnotatedMethod<?, ? super T> method : methods) {
                  if (method.getJavaMember().getDeclaringClass().equals(clazz)) {
                      builder.processMethod(method);
                  }
              }
              builder.levelFinish();
          }
          return builder.create();
      }
docs: Get all methods of a given kind using a given {@link MethodListBuilder}.