### Question:
BandedTaxCalculator implements TaxCalculator { @Override public double taxFor(double grossSalary) { return taxForBand(grossSalary) + taxForLowerBands(grossSalary); } BandedTaxCalculator(double minimumGross, double taxRate, TaxCalculator lowerBandCalculator); @Override double taxFor(double grossSalary);  }### Answer:
@Test public void lowerBandTaxIsZeroIfLowerBandCalculatorIsNull() { BandedTaxCalculator calculator = new BandedTaxCalculator(MINIMUM_GROSS_FOR_BAND, RATE_FOR_BAND, null); assertEquals(RATE_FOR_BAND * (2000 - MINIMUM_GROSS_FOR_BAND), calculator.taxFor(2000), 0); }
@Test public void allTaxIsFromLowerBandsIfGrossSalaryIsLessThanMinimumForBand() { assertEquals(TAX_FROM_LOWER_BAND, calculator.taxFor(MINIMUM_GROSS_FOR_BAND), 0); }
@Test public void taxIsSumOfTaxFromLowerBandsAndTaxFromThisBand() { assertEquals(TAX_FROM_LOWER_BAND + RATE_FOR_BAND * (2000 - MINIMUM_GROSS_FOR_BAND), calculator.taxFor(2000), 0); }