@Test
public void testComplexProperties() throws Exception {

    Map<String, Object> json = loadJSONResource("featureCollectionComplex.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()) {
        SimpleFeature f1 = it.hasNext() ? it.next() : null;
        SimpleFeature f2 = it.hasNext() ? it.next() : null;
        assertFalse(it.hasNext());
        assertNotNull(f1);
        assertNotNull(f2);
        assertEquals("P_10000001", f1.getID());
        assertEquals("P_10000002", f2.getID());
        
        assertEquals(10000001, f1.getAttribute("placeId"));  
        assertEquals(3, f1.getAttribute("placeVersionId"));
        assertEquals(1010110, f1.getAttribute("placeType"));
        assertEquals("M3233D4", f1.getAttribute("tm35MapSheet"));
        assertEquals("2008-12-05T22:00:00Z", f1.getAttribute("placeCreationTime"));
        assertNull(f1.getAttribute("placeNameDeletionTime"));
        Geometry expected = new WKTReader().read("POINT (21.3587384 61.3939013)");
        assertEquals(expected, f1.getDefaultGeometry());
        @SuppressWarnings("unchecked")
        List<Map<String, Object>> placenames = (List<Map<String, Object>>) f1.getAttribute("name");
        assertEquals(1, placenames.size());
        Map<String, Object> placename = placenames.get(0);
        assertEquals(40000001, placename.get("placeNameId"));
        assertEquals(1, placename.get("placeNameVersionId"));
        assertEquals("Isokloppa", placename.get("spelling"));
        assertEquals("fin", placename.get("language"));
    }
}