TimeInterval oldCurrent = (TimeInterval)oldUnrequested.next(); newUnrequestedTimeIntervals.addAll(oldCurrent.subtractInterval(current.requestedTimeInterval));
TimeSpan oldCurrent = (TimeSpan) oldUnrequested.next(); newUnrequestedTimeIntervals.addAll(TimeInterval.removeInterval(current.requestedTimeInterval, oldCurrent));
    boolean containsRequest(String providerName, TimeInterval requestedTimeInterval) {      TimeInterval unrequested = 	new TimeInterval(requestedTimeInterval.getStartTime(),			 requestedTimeInterval.getEndTime());      ArrayList unRequestedTimeIntervals = new ArrayList();      unRequestedTimeIntervals.add(unrequested);            for (Iterator requests = serviceRequestRecords.iterator();	   requests.hasNext();) {	ServiceRequestRecord current = (ServiceRequestRecord) requests.next();	ArrayList newUnrequestedTimeIntervals = new ArrayList();		if (current.providerName.equals(providerName)) {	  for (Iterator oldUnrequested = unRequestedTimeIntervals.iterator();	       oldUnrequested.hasNext();) {	    TimeInterval oldCurrent = (TimeInterval)oldUnrequested.next();	    newUnrequestedTimeIntervals.addAll(oldCurrent.subtractInterval(current.requestedTimeInterval));	  }	  unRequestedTimeIntervals = newUnrequestedTimeIntervals;	}      }            if (unRequestedTimeIntervals.isEmpty()) {	return true;      } else {	for (Iterator unrequestedIterator = unRequestedTimeIntervals.iterator();	     unrequestedIterator.hasNext();) {	  TimeInterval current = (TimeInterval) unrequestedIterator.next();	  //may need to add an epsilon ball around each time	  if (current.getStartTime() != current.getEndTime()) {	    return false;	  }	}	return true;      }    }