@Test public void should_not_fail_if_no_optimization_is_possible() { final List<Debt> debts = Arrays.asList( debt(matthias, amount(2), thomas), debt(david, amount(12), thomasB), debt(jacqueline, amount(1), simon) ); final List<Debt> optimizedDebts = sut.optimize(debts); assertThat(optimizedDebts, is(debts)); }
@Override public List<Debt> optimize(List<Debt> debts) { return new MinimalNumberOfDebtsOptimizer(debts).getMinimalNumberOfDebts(); }
MinimalNumberOfDebtsOptimizerStrategy implements OptimizerStrategy { @Override public List<Debt> optimize(List<Debt> debts) { return new MinimalNumberOfDebtsOptimizer(debts).getMinimalNumberOfDebts(); } }
MinimalNumberOfDebtsOptimizerStrategy implements OptimizerStrategy { @Override public List<Debt> optimize(List<Debt> debts) { return new MinimalNumberOfDebtsOptimizer(debts).getMinimalNumberOfDebts(); }  }
MinimalNumberOfDebtsOptimizerStrategy implements OptimizerStrategy { @Override public List<Debt> optimize(List<Debt> debts) { return new MinimalNumberOfDebtsOptimizer(debts).getMinimalNumberOfDebts(); }  @Override List<Debt> optimize(List<Debt> debts); }
MinimalNumberOfDebtsOptimizerStrategy implements OptimizerStrategy { @Override public List<Debt> optimize(List<Debt> debts) { return new MinimalNumberOfDebtsOptimizer(debts).getMinimalNumberOfDebts(); }  @Override List<Debt> optimize(List<Debt> debts);  }