if (layer.getIndex().count() < 1) {
System.out.println("Warning: index count zero: " + layer.getName());
}
System.out.println("Layer '" + layer.getName() + "' has " + layer.getIndex().count() + " entries in the index");
GraphDatabaseService graphDb = layer.getSpatialDatabase().getDatabase();
DataStore store = new Neo4jSpatialDataStore(graphDb);
try (Transaction tx = graphDb.beginTx()) {
SimpleFeatureCollection features = store.getFeatureSource(layer.getName()).getFeatures();
int featuresSize = features.size();
int indexCount = layer.getIndex().count();
System.out.println("Layer '" + layer.getName() + "' has " + featuresSize + " features");
assertEquals("FeatureCollection.size for layer '" + layer.getName() + "' not the same as index count",
indexCount, featuresSize);