class LoanDisbursementCoupledToCustomerMeetingScheduleStrategyImpl implements LoanDisbursementStrategy {

    @Override
    public boolean isDisbursementDateValidInRelationToSchedule(LocalDate disbursementDate) {
        
        boolean result = false;
        
        if (disbursementDate.isEqual(this.nextValidCustomerMeetingDate)) {
            result = true;
        } else if (disbursementDate.isAfter(this.nextValidCustomerMeetingDate)) {
            LocalDate matchingDate = this.nextValidCustomerMeetingDate;
            matchingDate = new LocalDate(scheduledEvent.nextEventDateAfter(matchingDate.toDateMidnight().toDateTime()));
            while(matchingDate.isBefore(disbursementDate)) {
                matchingDate = new LocalDate(scheduledEvent.nextEventDateAfter(matchingDate.toDateMidnight().toDateTime()));
            }
            
            if (matchingDate.isEqual(disbursementDate)) {
                result = true;
            }
        }
        
        return result;
    }

    public  LoanDisbursementCoupledToCustomerMeetingScheduleStrategyImpl(ScheduledEvent scheduledEvent, LocalDate nextValidCustomerMeetingDate);

}