@Test
public void basicTest() throws Exception {

  final GeoWaveAvroFeatureDataAdapter adapter = new GeoWaveAvroFeatureDataAdapter(schema);
  final GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory();
  final SimpleFeatureBuilder featureBuilder = new SimpleFeatureBuilder(schema);
  final int numFeatures = 10;
  final List<SimpleFeature> data = new ArrayList<>();
  final Map<Integer, SimpleFeature> dataMap = new HashMap<>();
  // Write data using the whole feature data adapter
  for (int i = 0; i < numFeatures; i++) {
    final Point point = geometryFactory.createPoint(new Coordinate(i, i));
    featureBuilder.set("geometry", point);
    featureBuilder.set("pop", i);
    featureBuilder.set("when", new Date(0));
    featureBuilder.set("whennot", new Date());
    data.add(featureBuilder.buildFeature(Integer.toString(i)));
    dataMap.put(i, data.get(data.size() - 1));
  }
  ingestCannedData(adapter, data);
  final Coordinate[] coordArray = new Coordinate[5];
  coordArray[0] = new Coordinate(-180, -90);
  coordArray[1] = new Coordinate(180, -90);
  coordArray[2] = new Coordinate(180, 90);
  coordArray[3] = new Coordinate(-180, 90);
  coordArray[4] = new Coordinate(-180, -90);
  // read data using the whole feature data adapter
  VectorQueryBuilder bldr =
      VectorQueryBuilder.newBuilder().addTypeName(adapter.getTypeName()).indexName(INDEX_NAME);
  bldr =
      bldr.constraints(
          bldr.constraintsFactory().spatialTemporalConstraints().spatialConstraints(
              new GeometryFactory().createPolygon(coordArray)).build());
  try (final CloseableIterator<SimpleFeature> itr = dataStore.query(bldr.build())) {
    while (itr.hasNext()) {
      final SimpleFeature feat = itr.next();
      final SimpleFeature feature = dataMap.remove(Integer.parseInt(feat.getID()));
      assertEquals(DataUtilities.encodeFeature(feature), DataUtilities.encodeFeature(feat));
    }
    assertTrue(dataMap.isEmpty());
  }
}