1 2 public class CapitalStrategyTermLoan extends CapitalStrategy { 3 4 @Override 5 public double capital(Loan loan) { 6 return riskAmountFor(loan) * duration(loan) * riskFactorFor(loan); 7 } 8 9 protected double riskAmountFor(Loan loan){ 10 return loan.getCommitment(); 11 } 12 13 protected double riskFactorFor(Loan loan) { 14 return 2.0; 15 } 16 17 protected double duration(Loan loan) { 18 return 1.0; 19 } 20 21 }