code: protected CollectionMatch getCollectionMatch(List<WebResourceCollection> webResourceCollections, String resourceName, String method) {
          CollectionMatch bestMatch = getInitialCollectionMatch();
          for (WebResourceCollection webResourceCollection : webResourceCollections) {
  
              CollectionMatch currentMatch = getCollectionMatchForWebResourceCollection(webResourceCollection, resourceName, method);
              if (currentMatch != null) {
                  bestMatch = selectBestCollectionMatch(bestMatch, currentMatch);
              }
  
              if (bestMatch != null && bestMatch.isExactMatch()) {
                  break;
              }
          }
  
          return bestMatch;
      }
docs: Gets the match for the resource access. The web resource collections are
  individually used to determine what is the match for this resource access. The best match is selected.
  The seven standard HTTP methods are,
  GET, POST, DELETE, PUT, HEAD, OPTIONS, and TRACE.
  
  @param resourceName The resource name.
  @param method The HTTP method.
  @return the collection match.