POSCreditOrder extends Order { @Override public void checkout() { paymentProcessor.chargeCard(paymentDetails, cart); super.checkout(); } POSCreditOrder(Cart cart, PaymentDetails paymentDetails); @Override void checkout();  }
@Test public void checkoutOnlineOrder() { Order order = new POSCreditOrder(createCart(), createPaymentDetails()); order.checkout(); }