1 2 public abstract class CapitalStrategy { 3 public final double capital(Loan loan) { 4 return riskAmountFor(loan) * duration(loan) * riskFactorFor(loan); 5 } 6 7 protected abstract double riskAmountFor(Loan loan); 8 protected abstract double duration(Loan loan); 9 protected abstract double riskFactorFor(Loan loan); 10 }