Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
oldstrategy
final PriceCalculatorFactory factory = new PriceCalculatorFactory();
final Item newItem = new Item(1L, new BigDecimal("12.99"));
final DeliveryPriceCalculator priceCalculator = factory.priceCalculatorFor(OldStylePlan.BASIC);
System.out.println("Delivery price is " + priceCalculator.priceFor(newItem));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.