TransformStreams { public SortedSet<LocalDate> p03_getOrderDatesAscending(Customer customer) { return customer.getOrders().stream() .map(Order::getCreationDate) .collect(toCollection(TreeSet::new)); }  List<OrderDto> p01_toDtos(List<Order> orders); Set<PaymentMethod> p02_getUsedPaymentMethods(Customer customer); SortedSet<LocalDate> p03_getOrderDatesAscending(Customer customer); Map<Long, Order> p04_mapOrdersById(Customer customer); Map<PaymentMethod, List<Order>> p05_getProductsByPaymentMethod(Customer customer); Map<Product, Long> p06_getProductCount(Customer customer); List<Product> p07_getAllOrderedProducts(Customer customer); String p08_getProductsJoined(Customer customer); Long p09_getApproximateTotalOrdersPrice(Customer customer); List<OrderLine> p10_readOrderFromFile(File file);  }
@Test public void p03_getOrderDatesAscending() { Order order1 = new Order().setCreationDate(today); Order order1bis = new Order().setCreationDate(today); Order order2 = new Order().setCreationDate(yesterday); List<LocalDate> expected = Arrays.asList(yesterday, today); Collection<LocalDate> actual = service.p03_getOrderDatesAscending(new Customer(order1, order1bis, order2)); assertEquals(expected, new ArrayList<>(actual)); }