public boolean containsTemplate(@NotNull @NlsSafe final String key, @Nullable @NonNls final String id) {
    return ContainerUtil.or(getElements(), template -> key.equals(template.getKey()) || id != null && id.equals(template.getId()));
  }
public boolean containsTemplate(@NotNull @NlsSafe final String key, @Nullable @NonNls final String id)