public static boolean isValid(Timestamp validFrom,Timestamp validTo,Timestamp testDate){
  if (testDate == null)   return true;
  if (validFrom == null && validTo == null)   return true;
  if (validFrom != null && validFrom.after(testDate))   return false;
  if (validTo != null && validTo.before(testDate))   return false;
  return true;
}

public static boolean isValid ( Timestamp validFrom , Timestamp validTo , Timestamp testDate ) { if ( testDate == null ) return true ; if ( validFrom == null && validTo == null ) return true ; if ( validFrom != null && validFrom . after ( testDate ) ) return false ; if ( validTo != null && validTo . before ( testDate ) ) return false ; return true ; }
is it valid on test date
