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

    File file = new File(getClass().getResource("waypoints.gpx").toURI());
    GPXParser parser = new GPXParser();
    SimpleFeatureCollection fc = parser.parse(file, null, DefaultGeographicCRS.WGS84);
    assertEquals(2, fc.size());
    SimpleFeatureIterator it = fc.features();
    try {
        int i = 1;
        while (it.hasNext()) {
            SimpleFeature f = it.next();
            assertEquals("name" + i, f.getAttribute("name"));
            assertEquals("cmt" + i, f.getAttribute("cmt"));
            assertEquals("desc" + i, f.getAttribute("desc"));
            assertEquals("src" + i, f.getAttribute("src"));
            assertEquals("http://li.nk/" + i, f.getAttribute("linkHref"));
            assertEquals("linktext" + i, f.getAttribute("linkText"));
            assertEquals("WayPoint", f.getAttribute("type"));
            i++;
        }
    } finally {
        it.close();
    }
}