@Test public void testCreateCommissionPolicy() throws Exception { final DefaultCommissionPolicyFactory factory = new DefaultCommissionPolicyFactory(); final Order sellOrder = new Order(OrderType.SELL); final CommissionPolicy sellPolicy = factory.createCommissionPolicy(sellOrder); final Order buyOrder = new Order(OrderType.BUY); final CommissionPolicy buyPolicy = factory.createCommissionPolicy(buyOrder); assertThat(sellPolicy, instanceOf(FixedRateCommissionPolicy.class)); assertThat(buyPolicy, instanceOf(FixedRateCommissionPolicy.class)); }
@Override public CommissionPolicy createCommissionPolicy(Order order) { return new FixedRateCommissionPolicy(); }
DefaultCommissionPolicyFactory implements CommissionPolicyFactory { @Override public CommissionPolicy createCommissionPolicy(Order order) { return new FixedRateCommissionPolicy(); } }
DefaultCommissionPolicyFactory implements CommissionPolicyFactory { @Override public CommissionPolicy createCommissionPolicy(Order order) { return new FixedRateCommissionPolicy(); }  }
DefaultCommissionPolicyFactory implements CommissionPolicyFactory { @Override public CommissionPolicy createCommissionPolicy(Order order) { return new FixedRateCommissionPolicy(); }  @Override CommissionPolicy createCommissionPolicy(Order order); }
DefaultCommissionPolicyFactory implements CommissionPolicyFactory { @Override public CommissionPolicy createCommissionPolicy(Order order) { return new FixedRateCommissionPolicy(); }  @Override CommissionPolicy createCommissionPolicy(Order order);  }