LPS-43061 fix the collection API so it's more maintainable
LPS-43061 Make sure to preserve the order based on priority and serviceId (via the ServiceReference key)