class HolidayCalendarIniLookup implements NamedLookup<HolidayCalendar> {

  @VisibleForTesting
  static ImmutableMap<Currency, HolidayCalendarId> loadDefaultsFromIni(String filename) {
    List<ResourceLocator> resources = ResourceConfig.orderedResources(filename);
    Map<Currency, HolidayCalendarId> map = new HashMap<>();
    for (ResourceLocator resource : resources) {
      try {
        IniFile ini = IniFile.of(resource.getCharSource());
        PropertySet section = ini.section("defaultByCurrency");
        for (String currencyCode : section.keys()) {
          map.put(Currency.of(currencyCode), HolidayCalendarId.of(section.value(currencyCode)));
        }
      } catch (RuntimeException ex) {
        log.log(Level.SEVERE, "Error processing resource as Holiday Calendar Defaults INI file: " + resource, ex);
        return ImmutableMap.of();
      }
    }
    return ImmutableMap.copyOf(map);
  }

  private  HolidayCalendarIniLookup();

}