public static boolean isValid(Date expirationDate){
  Date currentDate=new Date();
  String formattedDate=dateFormat.format(currentDate);
  currentDate=convertDate(formattedDate);
  boolean isExpired=currentDate.after(expirationDate);
  boolean isEqual=currentDate.equals(expirationDate);
  return isExpired || isEqual;
}

public static boolean isValid ( Date expirationDate ) { Date currentDate = new Date ( ) ; String formattedDate = dateFormat . format ( currentDate ) ; currentDate = convertDate ( formattedDate ) ; boolean isExpired = currentDate . after ( expirationDate ) ; boolean isEqual = currentDate . equals ( expirationDate ) ; return isExpired || isEqual ; }
validate the token expiration date .
