test_class.file: exercise_three/src/test/java/com/typesafe/training/coffeehouse/BaristaTest.java
test_class.identifier: BaristaTest
test_class.superclass: extends BaseAkkaTestCase
test_case.body: @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);
      }};
    }
test_case.class_method_signature: BaristaTest.shouldSendCoffeePreparedWithRandomCoffeeForInaccurateResponse()
test_case.full_signature: @Test public void shouldSendCoffeePreparedWithRandomCoffeeForInaccurateResponse()
test_case.identifier: shouldSendCoffeePreparedWithRandomCoffeeForInaccurateResponse
test_case.invocations: deadLetters actorOf props duration tell getRef expectMsgClass duration add count filter stream equals isBetween assertThat
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldSendCoffeePreparedWithRandomCoffeeForInaccurateResponse()
focal_class.declarator: prepareCoffeeDuration
focal_class.modifier: private final
focal_class.original_string: private final FiniteDuration prepareCoffeeDuration;
focal_class.type: FiniteDuration
focal_class.var_name: prepareCoffeeDuration
focal_class.declarator: accuracy
focal_class.modifier: private final
focal_class.original_string: private final int accuracy;
focal_class.type: int
focal_class.var_name: accuracy
focal_class.file: exercise_three/src/main/java/com/typesafe/training/coffeehouse/Barista.java
focal_class.identifier: Barista
focal_class.class_method_signature: Barista.Barista(FiniteDuration prepareCoffeeDuration, int accuracy)
focal_class.full_signature: public  Barista(FiniteDuration prepareCoffeeDuration, int accuracy)
focal_class.identifier: Barista
focal_class.modifiers: public
focal_class.parameters: (FiniteDuration prepareCoffeeDuration, int accuracy)
focal_class.signature:  Barista(FiniteDuration prepareCoffeeDuration, int accuracy)
focal_class.class_method_signature: Barista.props(FiniteDuration prepareCoffeeDuration, int accuracy)
focal_class.full_signature: public static Props props(FiniteDuration prepareCoffeeDuration, int accuracy)
focal_class.identifier: props
focal_class.modifiers: public static
focal_class.parameters: (FiniteDuration prepareCoffeeDuration, int accuracy)
focal_class.return: Props
focal_class.signature: Props props(FiniteDuration prepareCoffeeDuration, int accuracy)
focal_class.class_method_signature: Barista.pickCoffee(Coffee coffee)
focal_class.full_signature: private Coffee pickCoffee(Coffee coffee)
focal_class.identifier: pickCoffee
focal_class.modifiers: private
focal_class.parameters: (Coffee coffee)
focal_class.return: Coffee
focal_class.signature: Coffee pickCoffee(Coffee coffee)
focal_class.superclass: extends AbstractLoggingActor
focal_method.body: public static Props props(FiniteDuration prepareCoffeeDuration, int accuracy){
          return Props.create(Barista.class, () -> new Barista(prepareCoffeeDuration, accuracy));
      }
focal_method.class_method_signature: Barista.props(FiniteDuration prepareCoffeeDuration, int accuracy)
focal_method.full_signature: public static Props props(FiniteDuration prepareCoffeeDuration, int accuracy)
focal_method.identifier: props
focal_method.invocations: create
focal_method.modifiers: public static
focal_method.parameters: (FiniteDuration prepareCoffeeDuration, int accuracy)
focal_method.return: Props
focal_method.signature: Props props(FiniteDuration prepareCoffeeDuration, int accuracy)