@Test public void testNoChanges() { List<ServiceType> randoms = Arrays.asList(random1, random2); assertTrue(serviceChangeChecker.check(randoms, randoms).isEmpty()); List<ServiceType> empty = Arrays.asList(random1, random2); assertTrue(serviceChangeChecker.check(empty, empty).isEmpty()); }
public ServiceChanges check(List<ServiceType> oldServices, List<ServiceType> newServices) { List<String> oldFullServiceCodes = toFullServiceCodes(oldServices); List<String> newFullServiceCodes = toFullServiceCodes(newServices); List<ServiceType> addedServices = new ArrayList<>(newServices); addedServices.removeIf(serviceType -> oldFullServiceCodes .contains(FormatUtils.getServiceFullName(serviceType))); List<ServiceType> removedServices = new ArrayList<>(oldServices); removedServices.removeIf(serviceType -> newFullServiceCodes .contains(FormatUtils.getServiceFullName(serviceType))); return new ServiceChanges(addedServices, removedServices); }
ServiceChangeChecker { public ServiceChanges check(List<ServiceType> oldServices, List<ServiceType> newServices) { List<String> oldFullServiceCodes = toFullServiceCodes(oldServices); List<String> newFullServiceCodes = toFullServiceCodes(newServices); List<ServiceType> addedServices = new ArrayList<>(newServices); addedServices.removeIf(serviceType -> oldFullServiceCodes .contains(FormatUtils.getServiceFullName(serviceType))); List<ServiceType> removedServices = new ArrayList<>(oldServices); removedServices.removeIf(serviceType -> newFullServiceCodes .contains(FormatUtils.getServiceFullName(serviceType))); return new ServiceChanges(addedServices, removedServices); } }
ServiceChangeChecker { public ServiceChanges check(List<ServiceType> oldServices, List<ServiceType> newServices) { List<String> oldFullServiceCodes = toFullServiceCodes(oldServices); List<String> newFullServiceCodes = toFullServiceCodes(newServices); List<ServiceType> addedServices = new ArrayList<>(newServices); addedServices.removeIf(serviceType -> oldFullServiceCodes .contains(FormatUtils.getServiceFullName(serviceType))); List<ServiceType> removedServices = new ArrayList<>(oldServices); removedServices.removeIf(serviceType -> newFullServiceCodes .contains(FormatUtils.getServiceFullName(serviceType))); return new ServiceChanges(addedServices, removedServices); }  }
ServiceChangeChecker { public ServiceChanges check(List<ServiceType> oldServices, List<ServiceType> newServices) { List<String> oldFullServiceCodes = toFullServiceCodes(oldServices); List<String> newFullServiceCodes = toFullServiceCodes(newServices); List<ServiceType> addedServices = new ArrayList<>(newServices); addedServices.removeIf(serviceType -> oldFullServiceCodes .contains(FormatUtils.getServiceFullName(serviceType))); List<ServiceType> removedServices = new ArrayList<>(oldServices); removedServices.removeIf(serviceType -> newFullServiceCodes .contains(FormatUtils.getServiceFullName(serviceType))); return new ServiceChanges(addedServices, removedServices); }  ServiceChanges check(List<ServiceType> oldServices, List<ServiceType> newServices); }
ServiceChangeChecker { public ServiceChanges check(List<ServiceType> oldServices, List<ServiceType> newServices) { List<String> oldFullServiceCodes = toFullServiceCodes(oldServices); List<String> newFullServiceCodes = toFullServiceCodes(newServices); List<ServiceType> addedServices = new ArrayList<>(newServices); addedServices.removeIf(serviceType -> oldFullServiceCodes .contains(FormatUtils.getServiceFullName(serviceType))); List<ServiceType> removedServices = new ArrayList<>(oldServices); removedServices.removeIf(serviceType -> newFullServiceCodes .contains(FormatUtils.getServiceFullName(serviceType))); return new ServiceChanges(addedServices, removedServices); }  ServiceChanges check(List<ServiceType> oldServices, List<ServiceType> newServices);  }