Inspect Actor Internal State in Unit Test

You aren’t supposed to access an actor except through the ActorRef, but if you really need to (e.g. for a unit test), it is possible. actorOf can take a block, in which you can do anything so long as you return an Actor. So, you can directly access the Actor like this: