### Question:
FeatureTypeAdapterFeatureSource extends ForwardingFeatureSource<T, F> { public @Override FeatureCollection<T, F> getFeatures(Query query) throws IOException { final FeatureCollection<T, F> features = super.getFeatures(query); return new ForwardingFeatureCollection<T, F>(features) { public @Override FeatureIterator<F> features() { if (((T) delegate.getSchema()).getDescriptors().size() != featureType .getDescriptors().size()) { throw new GeoToolsOpException( GeoToolsOpException.StatusCode.INCOMPATIBLE_FEATURE_TYPE); } GeometryDescriptor geomDescriptorOrg = ((T) delegate.getSchema()) .getGeometryDescriptor(); GeometryDescriptor geomDescriptorDest = featureType.getGeometryDescriptor(); if (!geomDescriptorOrg.getType().getBinding() .equals(geomDescriptorDest.getType().getBinding())) { throw new GeoToolsOpException( GeoToolsOpException.StatusCode.INCOMPATIBLE_FEATURE_TYPE); } AbstractReferenceSystem crsOrg = (AbstractReferenceSystem) ((T) delegate .getSchema()).getCoordinateReferenceSystem(); AbstractReferenceSystem crsDest = (AbstractReferenceSystem) featureType .getCoordinateReferenceSystem(); if (!crsOrg.equals(crsDest, false)) { throw new GeoToolsOpException( GeoToolsOpException.StatusCode.INCOMPATIBLE_FEATURE_TYPE); } FeatureIterator<F> iterator = delegate.features(); SimpleFeatureBuilder builder = new SimpleFeatureBuilder( (SimpleFeatureType) featureType); return new FeatureTypeConverterIterator<F>(iterator, (SimpleFeatureBuilder) builder); } public @Override T getSchema() { return featureType; } }; } FeatureTypeAdapterFeatureSource(final FeatureSource<T, F> source, final T featureType); @Override T getSchema(); void setForbidSorting(boolean forbidSorting); @Override QueryCapabilities getQueryCapabilities(); @Override FeatureCollection<T, F> getFeatures(Query query);  }### Answer:
@Test public void testFeatureTypeAdapterHandlesSimilarCRSes() throws SchemaException, IOException { SimpleFeatureType schema1 = createSampleType((CoordinateReferenceSystem) PROJ_EPSG4326_CRS); SimpleFeatureType schema2 = createSampleType( (CoordinateReferenceSystem) PROJ_EQUIV_EPSG4326_CRS); SimpleFeature f1 = DataUtilities.template(schema1); f1.setDefaultGeometry(gf.createPoint(new Coordinate(1, 1))); SimpleFeature f2 = DataUtilities.template(schema1); f2.setDefaultGeometry(gf.createPoint(new Coordinate(2, 2))); SimpleFeature[] features = new SimpleFeature[] { f1, f2 }; SimpleFeatureSource fs = DataUtilities.source(features); FeatureTypeAdapterFeatureSource ftafs = new FeatureTypeAdapterFeatureSource(fs, schema2); List<SimpleFeature> newFeatures = DataUtilities.list(ftafs.getFeatures()); Assert.isTrue(f1.equals(newFeatures.get(0))); Assert.isTrue(f2.equals(newFeatures.get(1))); }