@Test
public void shouldSendCoffeePreparedWithRandomCoffeeForInaccurateResponse() {

  new JavaTestKit(system) {{
    Integer accuracy = 50;
    Long runs = 1000L;
    ActorRef guest = system.deadLetters();
    ActorRef barista = system.actorOf(Barista.props(duration("0 milliseconds"), accuracy));
    List<Coffee> coffees = new ArrayList<>();
    for(int i = 0; i < runs; i++) {
      barista.tell(new Barista.PrepareCoffee(new Coffee.Akkaccino(), guest), getRef());
      Barista.CoffeePrepared cp = expectMsgClass(duration("50 milliseconds"), Barista.CoffeePrepared.class);
      coffees.add(cp.coffee);
    }
    Long expectedCount = runs * accuracy / 100;
    Long variation = expectedCount / 10;
    Long numberOfCorrectCoffee = coffees.stream().filter(c -> c.equals(new Coffee.Akkaccino())).count();
    assertThat(numberOfCorrectCoffee).isBetween(expectedCount - variation, expectedCount + variation);
  }};
}