public long calculateEndTime(){
  if (endTime == 0) {
    return System.currentTimeMillis();
  }
 else   if (endTime < 0) {
    return System.currentTimeMillis() - endTime;
  }
  return endTime;
}

public long calculateEndTime ( ) { if ( endTime == 0 ) { return System . currentTimeMillis ( ) ; } else if ( endTime < 0 ) { return System . currentTimeMillis ( ) - endTime ; } return endTime ; }
this method returns an end time based on the configured value . if end time is less or equal to 0 , then its value will be deducted from the current time .
