Пример #1
0
  @Test
  public void test_findDiscountPrices() {
    long time1 =
        Performance.getConsumedTime(
            () -> {
              List<String> discountPrices = Shop.getDiscountPricesSync(shops, "MaxBook 11");

              assertEquals(shops.size(), discountPrices.size());
            });

    long time2 =
        Performance.getConsumedTime(
            () -> {
              List<String> discountPrices = Shop.getDiscountPricesAsync(shops, "MaxBook 11");

              assertEquals(shops.size(), discountPrices.size());
            });

    System.out.println("getDiscountPrices Sync: " + time1);
    System.out.println("getDiscountPrices Async: " + time2);
  }