The second parameter to tell is the sender, so by passing the probe.getRef(), any message the actor sends back to sender() will end up in the probe which is why you can assert that you got a response with probe.expectMsgClass on the next line. If you put some other ActorRef there the response will be sent to that actor instead.