private static boolean isTwoDatesPresentInRequiredRange(Date segDate1,Date segDate2,long numberOfDaysAllowedToMerge){
  if (segDate1 == null || segDate2 == null) {
    return false;
  }
  Calendar cal1=Calendar.getInstance();
  cal1.set(segDate1.getYear(),segDate1.getMonth(),segDate1.getDate());
  Calendar cal2=Calendar.getInstance();
  cal2.set(segDate2.getYear(),segDate2.getMonth(),segDate2.getDate());
  long diff=cal2.getTimeInMillis() - cal1.getTimeInMillis();
  if ((diff / (24 * 60 * 60* 1000)) < numberOfDaysAllowedToMerge) {
    return true;
  }
  return false;
}

private static boolean isTwoDatesPresentInRequiredRange ( Date segDate1 , Date segDate2 , long numberOfDaysAllowedToMerge ) { if ( segDate1 == null || segDate2 == null ) { return false ; } Calendar cal1 = Calendar . getInstance ( ) ; cal1 . set ( segDate1 . getYear ( ) , segDate1 . getMonth ( ) , segDate1 . getDate ( ) ) ; Calendar cal2 = Calendar . getInstance ( ) ; cal2 . set ( segDate2 . getYear ( ) , segDate2 . getMonth ( ) , segDate2 . getDate ( ) ) ; long diff = cal2 . getTimeInMillis ( ) - cal1 . getTimeInMillis ( ) ; if ( ( diff / ( 24 * 60 * 60 * 1000 ) ) < numberOfDaysAllowedToMerge ) { return true ; } return false ; }
method to check if the load dates are complied to the configured dates .
