/**
  * @param array $data
  *
  * @return Message
  */
 public function enrichMetadata(array $data)
 {
     $metadata = $this->metadata->mergeWith($data);
     return new self($this->identifier, $this->payload, $metadata);
 }
 public function testCanBeMergedWithAdditionalData()
 {
     $additionalData = ['key2' => 'new_value', 'key3' => 'value3'];
     $metadata = $this->metadata->mergeWith($additionalData);
     $this->assertEquals(['key1' => 'value1', 'key2' => 'new_value', 'key3' => 'value3'], $metadata->all());
 }