@Test
public void testParseSampleData() throws ServiceException, URISyntaxException, FactoryException {

    File file = new File(getClass().getResource("samples.kml").toURI());
    KMLParser kml = new KMLParser();
    SimpleFeatureCollection fc = kml.parse(file, null, CRS.decode("EPSG:4326"));
    boolean foundHidden = false;
    boolean foundPentagon = false;
    // test schema
    SimpleFeatureType schema = fc.getSchema();
    assertEquals(3, schema.getAttributeCount());
    // test feature count
    assertEquals(20, fc.size());
    // loop features
    SimpleFeatureIterator it = fc.features();
    while (it.hasNext()){
        SimpleFeature feature = it.next();
        assertEquals(3, feature.getAttributeCount());
        // hidden placemark with no geometry
        if (feature.getDefaultGeometry() == null){
            foundHidden = true;
            assertEquals("Descriptive HTML", feature.getAttribute(KMLParser.KML_NAME));
        } else if ("The Pentagon".equals(feature.getAttribute(KMLParser.KML_NAME))) {
            foundPentagon = true;
            assertEquals("Shouldn't have kml LookAt attribute", null, feature.getAttribute("LookAt"));
            Polygon p = (Polygon) feature.getDefaultGeometry();
            assertEquals(1, p.getNumInteriorRing());
            LineString ring = p.getExteriorRing();
            assertEquals (6, ring.getNumPoints());
            Coordinate c = ring.getCoordinateN(0);
            // KML has always lonlat 4326, but 4326 has latlon ordering
            assertEquals(38.87253259892824, c.x, 1e-6);
            assertEquals(-77.05788457660967, c.y, 1e-6);
            assertEquals(100.0, c.z, 0);
            ring = p.getInteriorRingN(0);
            assertEquals (6, ring.getNumPoints());
            c = ring.getCoordinateN(0);
            assertEquals(38.87154239798456, c.x, 1e-6);
            assertEquals(-77.05668055019126, c.y, 1e-6);
            assertEquals(100.0, c.z, 0);
        }
    }
    assertEquals(true, foundHidden);
    assertEquals("Can't find The Pentagon. Has plane chrashed or just the test failed", true, foundPentagon);
}