}
public void setApplicantDateOfBirth(Date applicantDateOfBirth) {
Calendar today = Calendar.getInstance();
if(applicantDateOfBirth == null)
throw new BusinessRuleException("Date of birth of applicant cant be empty");
else{
int currentYear = today.get(Calendar.YEAR);
Calendar applicantBirthCal = Calendar.getInstance();
applicantBirthCal.setTime(applicantDateOfBirth);
int applicantBirthYear = applicantBirthCal.get(Calendar.YEAR);
if(currentYear-applicantBirthYear < 5)
throw new BusinessRuleException("The applicant must be atleast 5 years Old");
}
this.applicantDateOfBirth = applicantDateOfBirth;
}