TransformStreams { public String p08_getProductsJoined(Customer customer) { return p07_getAllOrderedProducts(customer).stream() .map(Product::getName) .sorted() .collect(joining(",")); }  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 p08_getProductsNamesJoined() { Product armchair = new Product("Armchair"); Product chair = new Product("Chair"); Product table = new Product("Table"); Order order1 = new Order( new OrderLine(chair, 3)); Order order2 = new Order( new OrderLine(armchair, 1), new OrderLine(table, 1), new OrderLine(chair, 1)); String actual = service.p08_getProductsJoined(new Customer(order1, order2)); assertEquals("Armchair,Chair,Table", actual); }