ActorSystem system = ActorSystem.create(); new JavaTestKit( system ) {{ final JavaTestKit probe = new JavaTestKit( system ); final Props props = Props.create( SupervisorActor.class ); final TestActorRef<SupervisorActor> supervisorActor = TestActorRef.create( system, props, "Superman" ); supervisorActor.tell( callCommand, getTestActor() ); probe.expectMsgEquals(42); assertEquals(getRef(), probe.getLastSender()); }};