[PLAT-6155] Use Maps.toMap() instead of Maps.asMap() because Maps.asMap() return a shared map which is not desirable in this case