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