// Path: core/src/main/java/com/github/filosganga/geogson/gson/GeometryAdapterFactory.java
// public final class GeometryAdapterFactory implements TypeAdapterFactory {
// 
//     @Override
//     @SuppressWarnings("unchecked")
//     public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
//         if (Geometry.class.isAssignableFrom(type.getRawType())) {
//             return (TypeAdapter<T>) new GeometryAdapter(gson);
//         } else if (Positions.class.isAssignableFrom(type.getRawType())) {
//             return (TypeAdapter<T>) new PositionsAdapter();
//         } else if (Feature.class.isAssignableFrom(type.getRawType())) {
//             return (TypeAdapter<T>) new FeatureAdapter(gson);
//         } else if (FeatureCollection.class.isAssignableFrom(type.getRawType())) {
//             return (TypeAdapter<T>) new FeatureCollectionAdapter(gson);
//         } else {
//             return null;
//         }
//     }
// }
// 
// Path: core/src/main/java/com/github/filosganga/geogson/model/FeatureCollection.java
// public class FeatureCollection implements Serializable {
// 
//     private static final long serialVersionUID = 1L;
// 
//     private final List<Feature> features;
// 
//     public FeatureCollection(List<Feature> features) {
//         this.features = features;
//     }
// 
//     public static FeatureCollection of(Feature...features) {
//         return new FeatureCollection(Arrays.asList(features));
//     }
// 
//     public List<Feature> features() {
//         return Collections.unmodifiableList(features);
//     }
// 
//     public int size() {
//         return features.size();
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(getClass(), this.features);
//     }
// 
//     @Override
//     public boolean equals(Object obj) {
//         if (this == obj) {
//             return true;
//         }
//         if (obj == null || getClass() != obj.getClass()) {
//             return false;
//         }
//         final FeatureCollection other = (FeatureCollection) obj;
//         return Objects.equals(this.features, other.features);
//     }
// 
//     @Override
//     public String toString() {
//         return "FeatureCollection{" +
//                 "features=" + features +
//                 '}';
//     }
// }


import com.github.filosganga.geogson.gson.GeometryAdapterFactory;
import com.github.filosganga.geogson.model.FeatureCollection;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import org.openjdk.jmh.annotations.Benchmark;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
package com.github.filosganga.geogson;




public class PerformanceTest {

    private static final Gson gson = new GsonBuilder().registerTypeAdapterFactory(new GeometryAdapterFactory()).create();

    private static Reader openReader(String resourceName) throws IOException {
        return new BufferedReader(new InputStreamReader(ClassLoader.getSystemResourceAsStream(resourceName)));
    }

    @Benchmark
    public void featureCollectionReading() throws Exception {
        try (Reader reader = openReader("feature-collection.json")) {
// Path: core/src/main/java/com/github/filosganga/geogson/gson/GeometryAdapterFactory.java
// public final class GeometryAdapterFactory implements TypeAdapterFactory {
// 
//     @Override
//     @SuppressWarnings("unchecked")
//     public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
//         if (Geometry.class.isAssignableFrom(type.getRawType())) {
//             return (TypeAdapter<T>) new GeometryAdapter(gson);
//         } else if (Positions.class.isAssignableFrom(type.getRawType())) {
//             return (TypeAdapter<T>) new PositionsAdapter();
//         } else if (Feature.class.isAssignableFrom(type.getRawType())) {
//             return (TypeAdapter<T>) new FeatureAdapter(gson);
//         } else if (FeatureCollection.class.isAssignableFrom(type.getRawType())) {
//             return (TypeAdapter<T>) new FeatureCollectionAdapter(gson);
//         } else {
//             return null;
//         }
//     }
// }
// 
// Path: core/src/main/java/com/github/filosganga/geogson/model/FeatureCollection.java
// public class FeatureCollection implements Serializable {
// 
//     private static final long serialVersionUID = 1L;
// 
//     private final List<Feature> features;
// 
//     public FeatureCollection(List<Feature> features) {
//         this.features = features;
//     }
// 
//     public static FeatureCollection of(Feature...features) {
//         return new FeatureCollection(Arrays.asList(features));
//     }
// 
//     public List<Feature> features() {
//         return Collections.unmodifiableList(features);
//     }
// 
//     public int size() {
//         return features.size();
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(getClass(), this.features);
//     }
// 
//     @Override
//     public boolean equals(Object obj) {
//         if (this == obj) {
//             return true;
//         }
//         if (obj == null || getClass() != obj.getClass()) {
//             return false;
//         }
//         final FeatureCollection other = (FeatureCollection) obj;
//         return Objects.equals(this.features, other.features);
//     }
// 
//     @Override
//     public String toString() {
//         return "FeatureCollection{" +
//                 "features=" + features +
//                 '}';
//     }
// }


// Path: core/src/test/java/com/github/filosganga/geogson/PerformanceTest.java
import com.github.filosganga.geogson.gson.GeometryAdapterFactory;
import com.github.filosganga.geogson.model.FeatureCollection;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import org.openjdk.jmh.annotations.Benchmark;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;

package com.github.filosganga.geogson;




public class PerformanceTest {

    private static final Gson gson = new GsonBuilder().registerTypeAdapterFactory(new GeometryAdapterFactory()).create();

    private static Reader openReader(String resourceName) throws IOException {
        return new BufferedReader(new InputStreamReader(ClassLoader.getSystemResourceAsStream(resourceName)));
    }

    @Benchmark
    public void featureCollectionReading() throws Exception {
        try (Reader reader = openReader("feature-collection.json")) {
            gson.fromJson(reader, FeatureCollection.class);