private static void addOrIncrement(Object2IntMap<Template> templates,
                                     Template template) {
    templates.mergeInt(template, 1, Math::addExact);
  }
private static void addOrIncrement(Object2IntMap<Template> templates,
                                     Template template)