Add Holidays to EUR Calendar

Hi! If I try
public static ReferenceData getEuroHolidays() {
HolidayCalendarId holCalId = HolidayCalendarId.defaultByCurrency(Currency.EUR);

    List<LocalDate> dates = new ArrayList();
    dates.add(LocalDate.of(2022, 12, 8));
    dates.add(LocalDate.of(2022, 12, 25));
    
    Map<HolidayCalendarId, List<LocalDate>> data = new HashMap<>();
    data.put(holCalId, dates);
    return ReferenceData.of(data);
}

I got this error Value for identifier ‘EUTA’ does not implement expected type ‘HolidayCalendar’.
What it’s wrong?
thk emy

HolidayCalendarId implements ReferenceDataId<HolidayCalendar>, which means that the data it expects in the map of reference data must be of type HolidayCalendar. Try creating an instance of ImmutableHolidayCalendar and putting that into reference data instead of the raw HashMap

Thk
But if i try

public static ReferenceData getEuroHolidays() {
HolidayCalendarId holCalId = HolidayCalendarId.defaultByCurrency(Currency.EUR);

    List<LocalDate> dates = new ArrayList();
    dates.add(LocalDate.of(2022, 12, 8));
    dates.add(LocalDate.of(2022, 12, 25));

    **ImmutableHolidayCalendar holidays = ImmutableHolidayCalendar.of(holCalId, dates, null);**
    return ReferenceData.of(holidays);
}

I got this error:
com.opengamma.strata.basics.date.ImmutableHolidayCalendar cannot be converted to java.util.Map<? extends com.opengamma.strata.basics.ReferenceDataId<?>,?>

Something like this:

ImmutableHolidayCalendar holidays = ImmutableHolidayCalendar.of(holCalId, dates, ImmutableSet.of());
Map<HolidayCalendarId, HolidayCalendar> data = new HashMap<>();
data.put(holCalId, immutableHolidayCalendar);
return ReferenceData.of(data);

Thanks Stephen. It’s work!

Stephen,if you have time, can you help me with post Calc of IRR vs MS XIRR ?
thank’s a lot