code: private Object setElementCollectionMap(MapType mapType, ByteBuffer thriftColumnValue, Object entity, Field field,
              MetamodelImpl metaModel, Class embeddedClass, boolean useNativeProtocol2)
      {
  
          Map result = new HashMap();
          MapSerializer mapSerializer = mapType.getSerializer();
          Map outputCollection = new HashMap();
          if (useNativeProtocol2)
          {
              outputCollection.putAll(mapSerializer.deserializeForNativeProtocol(thriftColumnValue, ProtocolVersion.V2));
          }
          else
          {
              outputCollection.putAll((Map) mapSerializer.deserialize(thriftColumnValue));
          }
  
          UserType usertype = (UserType) mapType.getValuesType();
  
          for (Object key : outputCollection.keySet())
          {
              Object embeddedObject = KunderaCoreUtils.createNewInstance(embeddedClass);
              Object value = populateEmbeddedRecursive((ByteBuffer) outputCollection.get(key), usertype.allTypes(),
                      usertype.fieldNames(), embeddedObject, metaModel);
              result.put(key, value);
          }
          PropertyAccessorHelper.set(entity, field, result);
          return entity;
      }
docs: Sets the element collection map.
  
  @param mapType
  the cql column metadata
  @param thriftColumnValue
  the thrift column value
  @param entity
  the entity
  @param field
  the field
  @param metaModel
  the meta model
  @param embeddedClass
  the embedded class
  @param useNativeProtocol2
  the use native protocol2
  @return the object