TransformStreams { public Set<PaymentMethod> p02_getUsedPaymentMethods(Customer customer) { return null; }  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 p02_getUsedPaymentMethods() { Order cardOrder = new Order().setPaymentMethod(PaymentMethod.CARD); Order cardOrder2 = new Order().setPaymentMethod(PaymentMethod.CARD); Order cashOnDeliveryOrder = new Order().setPaymentMethod(PaymentMethod.CASH_ON_DELIVERY); HashSet<PaymentMethod> expected = new HashSet<>(Arrays.asList(PaymentMethod.CARD, PaymentMethod.CASH_ON_DELIVERY)); assertEquals(expected, service.p02_getUsedPaymentMethods(new Customer(cardOrder, cardOrder2, cashOnDeliveryOrder))); }