### Question:
Waiter extends AbstractLoggingActor { public static Props props(ActorRef barista) { return Props.create(Waiter.class, () -> new Waiter(barista)); } Waiter(ActorRef barista); @Override Receive createReceive(); static Props props(ActorRef barista);  }### Answer:
@Test public void sendingServeCoffeeShouldResultInPrepareCoffeeToBarista() { new JavaTestKit(system) {{ ActorRef barista = getRef(); TestProbe guest = new TestProbe(system); ActorRef waiter = system.actorOf(Waiter.props(barista)); waiter.tell(new Waiter.ServeCoffee(new Coffee.Akkaccino()), guest.ref()); expectMsgEquals(new Barista.PrepareCoffee(new Coffee.Akkaccino(), guest.ref())); }}; }