@Test public void test_supplyAllPrices() { long start = System.nanoTime(); long time1 = Performance.getConsumedTime( () -> { Shop.supplyAllPrices( shops, "Mac Book 13", (price) -> { long diff = (System.nanoTime() - start) / 1000000; System.out.println(price + " (discounted) done in " + diff); }); }); System.out.println("supplyAllPrices time: " + time1); }