I'm trying to find the most simple way to cast a map<Object, List<Sobject>>
in any other type like, String, Integer and etc..
Anyone knows how to do this?
This is my code
Map<Object, SolicitationItem__c[]> mapHierarchyRequestToItem = (Map<Id,SolicitationItem__c[]>) Collection.of(newRecordsMap.values()).group().byField(SolicitationItem__c.HierarchySolicitation__c).get();
ERROR:
Incompatible types since an instance of Map<Object,List> is never an instance of Map<Id,List<SolicitationItem__c>> (11:72)
Collection.of()
? Are you using some library? Please edit to add details.