updater.maxSnapshotFrequency = (0);
updater.purgeExpiredData = (false);
updater.applyTripUpdates(Arrays.asList(TripUpdate.parseFrom(cancellation)), "agency");
TimetableResolver resolverA = updater.getTimetableSnapshot();
updater.purgeExpiredData = (true);
TripDescriptor.Builder tripDescriptorBuilder = TripDescriptor.newBuilder();
tripDescriptorBuilder.setTripId("1.1");
tripDescriptorBuilder.setScheduleRelationship(TripDescriptor.ScheduleRelationship.CANCELED);
tripDescriptorBuilder.setStartDate(previously.getAsString());
TripUpdate.Builder tripUpdateBuilder = TripUpdate.newBuilder();
tripUpdateBuilder.setTrip(tripDescriptorBuilder);
TripUpdate tripUpdate = tripUpdateBuilder.build();
updater.applyTripUpdates(Arrays.asList(tripUpdate), "agency");
TimetableResolver resolverB = updater.getTimetableSnapshot();
assertNotSame(resolverA, resolverB);
assertSame (resolverA.resolve(pattern, null ), resolverB.resolve(pattern, null ));
assertSame (resolverA.resolve(pattern, serviceDate),
resolverB.resolve(pattern, serviceDate));
assertNotSame(resolverA.resolve(pattern, null ), resolverA.resolve(pattern, serviceDate));
assertSame (resolverB.resolve(pattern, null ), resolverB.resolve(pattern, previously));
// TODO: write test for added trips
}