If you're using `var` you can just use a normal list here:

```scala
var publishedMessages: List[String] = Nil

override def publish(subject: String, message: String): Try[PublishResult] = {
  publishedMessages ::= s"$subject | $message"
  Success(new PublishResult())
}
```

I'd generally avoid mutating state like this, but if we have to it's better to use an immutable data structure, as they're inherently thread safe.