code: protected MethodWrapper getMethodWithMatchingPatternAndFilterUnmatchedMethods(String text, List<MethodWrapper> methodWrappers) {
          if (methodWrappers != null) {
              Iterator<MethodWrapper> listIterator = methodWrappers.listIterator();
  
              while (listIterator.hasNext()) {
                  MethodWrapper methodWrapper = listIterator.next();
                  String pattern = methodWrapper.getPattern();
                  int patternFlags = methodWrapper.getPatternFlags();
  
                  if (!StringUtils.isEmpty(pattern)) {
                      if (StringUtils.isEmpty(text)) {
                          listIterator.remove();
                          continue;
                      }
                      Pattern p = Pattern.compile(pattern, patternFlags);
                      Matcher m = p.matcher(text);
                      if (m.find()) {
                          methodWrapper.setMatcher(m);
                          return methodWrapper;
                      } else {
                          listIterator.remove();  // remove methods from the original list whose pattern do not match
                      }
                  }
              }
          }
          return null;
      }
docs: Search for a method whose {@link Controller#pattern()} match with the {@code Event} text or payload
  received from Slack/Facebook and also filter out the methods in {@code methodWrappers} whose
  {@link Controller#pattern()} do not match.
  
  @param text is the message from the user
  @param methodWrappers
  @return the MethodWrapper whose method pattern match with that of the slack message received, {@code null} if no
  such method is found.