TransformStreams { public List<OrderDto> p01_toDtos(List<Order> orders) { List<OrderDto> dtos = new ArrayList<>(); for (Order order : orders) { OrderDto dto = new OrderDto(); dto.totalPrice = order.getTotalPrice(); dto.creationDate = order.getCreationDate(); dtos.add(dto); } return dtos; }  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 p01_toDtos() { Order order1 = new Order().setCreationDate(today).setTotalPrice(BigDecimal.TEN); Order order2 = new Order().setCreationDate(yesterday).setTotalPrice(BigDecimal.ONE); List<OrderDto> dtos = service.p01_toDtos(Arrays.asList(order1, order2)); assertEquals(today, dtos.get(0).creationDate); assertEquals(BigDecimal.TEN, dtos.get(0).totalPrice); assertEquals(yesterday, dtos.get(1).creationDate); }