@Test
    public void testCalculateMortgage() throws Exception {
        Double loan = 20000d;
        InterestRate rate = new InterestRate(4d);
        LoanDuration duration = new LoanDuration(20);
        FixedRateMortgage mortgage = new FixedRateMortgage(loan, rate, duration);
        assertNotNull("FixedRateMortgage  should not be null", mortgage);


        FixedRateMortgage mortgageNull = null;
        try {
            mortgageNull = new FixedRateMortgage(loan, null, duration);
        } catch (Exception e) {}
        assertEquals(mortgageNull, null);
        try {
            mortgageNull = new FixedRateMortgage(loan, rate, null);
        } catch (Exception e) {}
        assertEquals(mortgageNull, null);
    }