public void testtotalCountableIncomeTimeline1() {
    final Number caseID = 1111L;
    final List<CaseParticipantRole> caseParticipantRoleList = createCaseParticipantRole();
    final List<SAHouseholdUnitMember> saHouseholdUnitMemberList =
        createSAHouseholdUnitMember(caseParticipantRoleList);

    final SAHouseholdUnitCalculator saHouseholdUnitCalculator =
        SAHouseholdUnitCalculator_Factory.getFactory().newInstance(getSession());
    saHouseholdUnitCalculator.mandatoryMembers().specifyValue(saHouseholdUnitMemberList);
    final List<Interval<Number>> amount = new ArrayList<Interval<Number>>();
    amount.add(new Interval<Number>(null, 0));
    amount.add(new Interval<Number>(Date.fromISO8601("20040601"), 3000));
    final Timeline<Number> amountTimeline = new Timeline<Number>(amount);

    final List<Interval<Number>> amount2 = new ArrayList<Interval<Number>>();
    amount2.add(new Interval<Number>(null, 0));
    amount2.add(new Interval<Number>(Date.fromISO8601("20040601"), 4000));
    final Timeline<Number> amount2Timeline = new Timeline<Number>(amount2);

    final List<Interval<Number>> amount3 = new ArrayList<Interval<Number>>();
    amount3.add(new Interval<Number>(null, 0));
    amount3.add(new Interval<Number>(Date.fromISO8601("20040601"), 0));
    final Timeline<Number> amount3Timeline = new Timeline<Number>(amount3);

    final FamilyOfMissingEligibilityUnitCalculator familyOfMissingObj =
        FamilyOfMissingEligibilityUnitCalculator_Factory.getFactory()
            .newInstance(getSession(), caseID, saHouseholdUnitCalculator);
    familyOfMissingObj.caseID().specifyValue(caseID);
    familyOfMissingObj.unearnedIncomeAmount().specifyValue(amountTimeline);
    familyOfMissingObj.totalExpenseAmountTimeline().specifyValue(amount2Timeline);
    CREOLETestHelper.assertEquals(
        amount3Timeline, familyOfMissingObj.totalCountableIncomeTimeline().getValue());
  }
  public void testhasHouseholdPassedIncomeTestTimeline1() {
    final Number caseID = 1111L;
    final List<CaseParticipantRole> caseParticipantRoleList = createCaseParticipantRole();
    final List<SAHouseholdUnitMember> saHouseholdUnitMemberList =
        createSAHouseholdUnitMember(caseParticipantRoleList);

    final SAHouseholdUnitCalculator saHouseholdUnitCalculator =
        SAHouseholdUnitCalculator_Factory.getFactory().newInstance(getSession());
    saHouseholdUnitCalculator.mandatoryMembers().specifyValue(saHouseholdUnitMemberList);

    final List<Interval<Number>> amount = new ArrayList<Interval<Number>>();
    amount.add(new Interval<Number>(null, 1000));
    amount.add(new Interval<Number>(Date.fromISO8601("20040601"), 6000));
    final Timeline<Number> amountTimeline = new Timeline<Number>(amount);

    final List<Interval<Number>> amount2 = new ArrayList<Interval<Number>>();
    amount2.add(new Interval<Number>(null, 0));
    amount2.add(new Interval<Number>(Date.fromISO8601("20040601"), 1000));
    final Timeline<Number> amount2Timeline = new Timeline<Number>(amount2);

    final List<Interval<Boolean>> result = new ArrayList<Interval<Boolean>>();
    result.add(new Interval<Boolean>(null, false));
    result.add(new Interval<Boolean>(Date.fromISO8601("20040601"), false));
    final Timeline<Boolean> resultTimeline = new Timeline<Boolean>(result);

    final FamilyOfMissingEligibilityUnitCalculator familyOfMissingObj =
        FamilyOfMissingEligibilityUnitCalculator_Factory.getFactory()
            .newInstance(getSession(), caseID, saHouseholdUnitCalculator);
    familyOfMissingObj.caseID().specifyValue(caseID);
    familyOfMissingObj.totalCountableIncomeTimeline().specifyValue(amountTimeline);
    familyOfMissingObj.primaryBeneficiaryAmount().specifyValue(amount2Timeline);
    CREOLETestHelper.assertEquals(
        resultTimeline, familyOfMissingObj.hasHouseholdPassedIncomeTestTimeline().getValue());
  }
  /**
   * Test case for 'totalExpenseAmountTimeline' attribute. Test Data: Expense records Test Class :
   * FamilyOfMissingEligibilityUnitCalculator
   */
  public void testTotalExpenseAmountTimeline() {
    final Number caseID = 1111L;
    final List<CaseParticipantRole> caseParticipantRoleList = createCaseParticipantRole();
    final List<SAHouseholdUnitMember> saHouseholdUnitMemberList =
        createSAHouseholdUnitMember(caseParticipantRoleList);

    final SAHouseholdUnitCalculator saHouseholdUnitCalculator =
        SAHouseholdUnitCalculator_Factory.getFactory().newInstance(getSession());
    saHouseholdUnitCalculator.mandatoryMembers().specifyValue(saHouseholdUnitMemberList);
    final FamilyOfMissingEligibilityUnitCalculator familyOfMissingObj =
        FamilyOfMissingEligibilityUnitCalculator_Factory.getFactory()
            .newInstance(getSession(), caseID, saHouseholdUnitCalculator);

    final List<Interval<Number>> amount = new ArrayList<Interval<Number>>();
    amount.add(new Interval<Number>(null, 0));
    amount.add(new Interval<Number>(Date.fromISO8601("20040601"), 0));
    final Timeline<Number> amountTimeline = new Timeline<Number>(amount);

    final List<Interval<Number>> amount2 = new ArrayList<Interval<Number>>();
    amount2.add(new Interval<Number>(null, 0));
    amount2.add(new Interval<Number>(Date.fromISO8601("20040601"), 1000));
    final Timeline<Number> amount2Timeline = new Timeline<Number>(amount2);

    // When income type is not COMMERCIAL

    Expense expenseObj = Expense_Factory.getFactory().newInstance(getSession());
    expenseObj.rentAmount().specifyValue(amount2Timeline);
    expenseObj.rentType().specifyValue(new CodeTableItem(EXPENSE.TABLENAME, EXPENSE.COMMERCIAL));
    expenseObj
        .frequency()
        .specifyValue(new CodeTableItem(FREQUENCYCODE.TABLENAME, FREQUENCYCODE.MONTHLY));
    expenseObj
        .participant()
        .specifyValue(caseParticipantRoleList.get(0).caseParticipantRoleID().getValue());
    expenseObj.caseID().specifyValue(caseID);

    final List<Expense> expenseList = new ArrayList<Expense>();
    expenseList.add(expenseObj);

    MemberCPRCalculator memberCPRCalculatorobj =
        MemberCPRCalculator_Factory.getFactory()
            .newInstance(getSession(), caseParticipantRoleList.get(0));
    memberCPRCalculatorobj.caseParticipantRoleRecord().specifyValue(caseParticipantRoleList.get(0));
    memberCPRCalculatorobj.expenseRecords().specifyValue(expenseList);

    familyOfMissingObj.caseID().specifyValue(caseParticipantRoleList.get(0).caseID().getValue());

    CREOLETestHelper.assertEquals(
        amountTimeline, familyOfMissingObj.totalExpenseAmountTimeline().getValue());
  }