SearchStreams { public Order p5_getMaxPriceOrder(Customer customer) { return null; }  List<Order> p1_getActiveOrders(Customer customer); Order p2_getOrderById(List<Order> orders, long orderId); boolean p3_hasActiveOrders(Customer customer); boolean p4_canBeReturned(Order order); Order p5_getMaxPriceOrder(Customer customer); List<Order> p6_getLast3Orders(Customer customer);  }
@Test public void p5_getMaxPriceOrder() { LocalDate yesterday = now().minusDays(1); Order order1 = new Order().setTotalPrice(BigDecimal.ONE).setCreationDate(now()); Order order2 = new Order().setTotalPrice(BigDecimal.TEN).setCreationDate(yesterday); assertEquals(order2, service.p5_getMaxPriceOrder(new Customer(order1, order2))); }
@Test public void p5_getMaxPriceOrder_whenNoOrders_returnsNothing() { assertNull(service.p5_getMaxPriceOrder(new Customer())); }