code: public static Map<String, Method> getAllCucumberMethods(Class<?> clazz) {
          final Map<String, Method> result = new HashMap<>();
          final CucumberOptions co = clazz.getAnnotation(CucumberOptions.class);
          final Set<Class<?>> classes = getClasses(co.glue());
          classes.add(BrowserSteps.class);
  
          for (final Class<?> c : classes) {
              final Method[] methods = c.getDeclaredMethods();
              for (final Method method : methods) {
                  for (final Annotation stepAnnotation : method.getAnnotations()) {
                      if (stepAnnotation.annotationType().isAnnotationPresent(StepDefAnnotation.class)) {
                          result.put(stepAnnotation.toString(), method);
                      }
                  }
              }
          }
          return result;
      }
docs: Gets all Cucumber methods.
  
  @param clazz
  Class which is the main point of the application (Decorated with the annotation {@link cucumber.api.CucumberOptions})
  @return a Map of all Cucumber glue code methods of the application. First part of the entry is the Gherkin matching regular expression.
  Second part is the corresponding invokable method.