code: ObjectName findMatchingMBeanPattern(ObjectName pName) {
          // Check all stored patterns for a match and return the pattern if one is found
          for (ObjectName pattern : patterns) {
              if (pattern.apply(pName)) {
                  return pattern;
              }
          }
          return null;
      }
docs: Given a MBean name return a pattern previously added and which matches this MBean name. Note,
  that patterns might not overlap since the order in which they are tried is undefined.
  
  @param pName name to match against
  @return the pattern found or <code>null</code> if none has been found.