code: public static Component scan(Component root, ScannerMatcher matcher) {
          if (matcher.matches(root)) return root;
          if (!(root instanceof Container)) return null;
          Container container = (Container) root;
          for (Component component : container.getComponents()) {
              Component found = scan(component, matcher);
              if (found != null) return found;
          }
          return null;
      }
docs: Scans a component tree searching for the one which is matched by the given matcher. In case of multiple matches
  the firs one found is returned.
  
  @param root The component root
  @param matcher The matcher
  @return The component found