question: private static Map < Integer , Collection < JsonArrayEntry > > groupJsonEntryByInstanceId ( Collection < JsonArrayEntry > jsonEntries , LwM2mPath baseName ) throws InvalidValueException { Map < Integer , Collection < JsonArrayEntry > > result = new HashMap < > ( ) ; for ( JsonArrayEntry e : jsonEntries ) { LwM2mPath nodePath = baseName . append ( e . getName ( ) ) ; if ( ! nodePath . isResourceInstance ( ) && ! nodePath . isResource ( ) ) { throw new InvalidValueException ( "Invalid path for resource, it should be a resource or a resource instance path" , nodePath ) ; } Collection < JsonArrayEntry > jsonArray = result . get ( nodePath . getObjectInstanceId ( ) ) ; if ( jsonArray == null ) { jsonArray = new ArrayList < > ( ) ; result . put ( nodePath . getObjectInstanceId ( ) , jsonArray ) ; } jsonArray . add ( e ) ; } return result ; }
target:  Group all JsonArrayEntry by instanceId