class BaseProvider {

  protected Map.Entry<String, Pattern> getRegexEntry(String id) {
    Map.Entry<String, Pattern> regexEntry = null;

    for (Map.Entry<String, Pattern> entry : patterns.entrySet()) {
      Pattern pattern = entry.getValue();
      Matcher matcher = pattern.matcher(id);

      if (matcher.matches()) {
        String key = entry.getKey();
        if (regexEntry == null || key.startsWith(regexEntry.getKey())) {
          regexEntry = entry;
        }
      }
    }
    return regexEntry;
  }

  public  BaseProvider(Set<String> propertyIds);

}