question: public TimePeriod ( Date startTime , long duration ) { Validate . notNull ( startTime ) ; Validate . isTrue ( duration > 0 ) ; this . startTime = startTime ; this . endTime = new Date ( startTime . getTime ( ) + duration ) ; }
target:  Creates time interval [startTime, startTime + duration).