SearchStreams { public List<Order> p1_getActiveOrders(Customer customer) { return customer.getOrders().stream() .filter(order -> order.isActive()) .collect(toList()); }  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 p1_getActiveOrders() { Order order1 = new Order(Status.ACTIVE); Order order2 = new Order(Status.ACTIVE); Order order3 = new Order(Status.DRAFT); Customer customer = new Customer(order1, order2, order3); assertEquals(Arrays.asList(order1, order2), service.p1_getActiveOrders(customer)); }