question: public TimePeriod ( Date startTime , Date endTime ) { if ( startTime != null && endTime != null && ! endTime . after ( startTime ) ) { throw new IllegalArgumentException ( "EndTime: " + endTime + " is not after startTime: " + startTime ) ; } this . startTime = startTime ; this . endTime = endTime ; }
target:  Creates time interval [startTime, endTime) if times are not null. Creates time interval (-Inf, endTime) if start time is null. Creates time interval [startTime, +Inf) if end time is null. Creates time interval (-Inf, +Inf) if both times are null.