private void testDiffFeatures(ObjectId oldRoot, ObjectId newRoot, int expectedAdded,
int expectedRemoved, int expectedChanged) throws IOException {
dataStore.setHead(newRoot.toString());
List<String> fids;
SimpleFeatureCollection features;
ChangeType changeType = ChangeType.ADDED;
features = dataStore.getDiffFeatureSource(pointsName, oldRoot.toString(), changeType)
.getFeatures();
fids = toIdList(features);
assertEquals(changeType + fids.toString(), expectedAdded, fids.size());
assertEquals(changeType + fids.toString(), expectedAdded, features.size());
changeType = ChangeType.REMOVED;
features = dataStore.getDiffFeatureSource(pointsName, oldRoot.toString(), changeType)
.getFeatures();
fids = toIdList(features);
assertEquals(changeType + fids.toString(), expectedRemoved, fids.size());
assertEquals(changeType + fids.toString(), expectedRemoved, features.size());
changeType = ChangeType.CHANGED_NEW;
features = dataStore.getDiffFeatureSource(pointsName, oldRoot.toString(), changeType)
.getFeatures();
fids = toIdList(features);
assertEquals(changeType + fids.toString(), expectedChanged, fids.size());
assertEquals(changeType + fids.toString(), expectedChanged, features.size());
changeType = ChangeType.CHANGED_OLD;
features = dataStore.getDiffFeatureSource(pointsName, oldRoot.toString(), changeType)
.getFeatures();
fids = toIdList(features);
assertEquals(changeType + fids.toString(), expectedChanged, fids.size());
assertEquals(changeType + fids.toString(), expectedChanged, features.size());
}