System.out.println("ALProviderPlugin old end time preference " + new Date((long)SDFactory.getPreference(sc.getServicePreferences(), Preference.END_TIME))); System.out.println("ALProviderPlugin old new time preference " + new Date((long)SDFactory.getPreference(newPreferences, Preference.END_TIME)));
  private ServiceContract getAlteredServiceContract(ServiceContractRelay relay,      ALStatusChangeMessage m) {    ServiceContract sc = relay.getServiceContract();    Iterator oldPreferences = sc.getServicePreferences().iterator();    ArrayList newPreferences = new ArrayList();    while(oldPreferences.hasNext()) {      Preference oldPref = (Preference) oldPreferences.next();      Preference newPref;      if(oldPref.getAspectType() == Preference.END_TIME) {        newPref = getFactory().newPreference(oldPref.getAspectType(),            changeDate(oldPref.getScoringFunction(), m.getEndDate()),            oldPref.getWeight());        newPreferences.add(newPref);      }      else {        newPref = getFactory().newPreference(oldPref.getAspectType(),            oldPref.getScoringFunction(),            oldPref.getWeight());        newPreferences.add(newPref);      }    }    System.out.println("ALProviderPlugin old end time preference " +                       new Date((long)SDFactory.getPreference(sc.getServicePreferences(),                       Preference.END_TIME)));    System.out.println("ALProviderPlugin old new time preference " +                       new Date((long)SDFactory.getPreference(newPreferences,                       Preference.END_TIME)));    ServiceContract newSc = mySDFactory.newServiceContract(getSelfOrg(),        sc.getServiceRole(), newPreferences);    return newSc;  }