@Test
@SuppressWarnings("unchecked")
public void testDeeplyComplex() throws Exception {

    // We delved too greedily and too deep
    Map<String, Object> json = loadJSONResource("featureCollectionDeeplyComplex.json");
    CoordinateReferenceSystem crs84 = CRS.decode("EPSG:4326", true);
    SimpleFeatureType schema = GeoJSONSchemaDetector.getSchema(json, crs84);
    SimpleFeatureCollection fc = GeoJSONReader2.toFeatureCollection(json, schema);
    try (SimpleFeatureIterator it = fc.features()) {
        assertTrue(it.hasNext()); 
        SimpleFeature f1 = it.next();
        assertFalse(it.hasNext());
        assertNotNull(f1);
        assertEquals("ABC_112", f1.getID());
        assertEquals("bar", f1.getAttribute("foo"));
        Map<String, Object> a = (Map<String, Object>) f1.getAttribute("a");
        List<Object> foo = (List<Object>) a.get("foo");
        Map<String, Object> fooThe3rd = (Map<String, Object>) foo.get(2);
        Map<String, Object> qux = (Map<String, Object>) fooThe3rd.get("qux");
        assertEquals("sure", qux.get("deep"));
        Geometry expectedGeometry = new WKTReader().read("POINT (21.3587384 61.3939013)");
        assertEquals(expectedGeometry, f1.getDefaultGeometry());
    }
}