desiredCoverageIntervals.add(new TimeInterval(desiredStart, desiredEnd));
desiredCoverageIntervals.add(TimeSpans.getSpan(desiredStart, desiredEnd));
  private Collection getCurrentlyUncoveredIntervals(long desiredStart, 						    long desiredEnd, 						    Role role) {    ArrayList desiredCoverageIntervals = new ArrayList();    desiredCoverageIntervals.add(new TimeInterval(desiredStart, desiredEnd));    Collection stillNeeded = desiredCoverageIntervals;    //go through the existing service contracts and remove the time    //periods which are covered already    for (Iterator relayIterator = myServiceContractRelaySubscription.iterator();         relayIterator.hasNext();) {      ServiceContractRelay relay =        (ServiceContractRelay) relayIterator.next();      if (!relay.getClient().equals(getSelfOrg())) {        continue;      }      ServiceContract contract = relay.getServiceContract();      if ((contract != null)  &&          (!contract.isRevoked()) &&          (contract.getServiceRole().equals(role))) {	TimeInterval providedTimeInterval = 	  getPreferenceTimeInterval(relay.getServiceContract().getServicePreferences());      	if (providedTimeInterval == null) {	  if (myLoggingService.isDebugEnabled()) {	    myLoggingService.debug(getAgentIdentifier() + 				   " getCurrentlyUncoveredIntervals: " +				   " contract with " + 				   relay.getProviderName() +				   " for " + role + 				   " does not have a valid time period.");	  }	} else {	  if (myLoggingService.isDebugEnabled()) {	    myLoggingService.debug(getAgentIdentifier() +				   " getCurrentlyUncoveredIntervals: " +				   " contract with " + 				   relay.getProviderName() +				   " for " + role + 				   " runs " + 				   providedTimeInterval.getStartTime() +				   " to " + providedTimeInterval.getEndTime());	  }	  // If contract specifies a valid time range, remove it.	  stillNeeded = 	    TimeInterval.removeInterval(providedTimeInterval,					stillNeeded);				 	}      }    }    return stillNeeded;  }