XMLRoadUtil { public static RoadSegment readRoadSegment(Element element, PathBuilder pathBuilder, XMLResources resources) throws IOException { return readRoadPolyline(element, pathBuilder, resources); } private  XMLRoadUtil(); static Element writeRoadPolyline(RoadPolyline primitive, XMLBuilder builder,
			XMLResources resources); static RoadPolyline readRoadPolyline(Element element, PathBuilder pathBuilder,
			XMLResources resources); static Element writeRoadSegment(RoadSegment primitive, XMLBuilder builder, XMLResources resources); static RoadSegment readRoadSegment(Element element, PathBuilder pathBuilder,
			XMLResources resources); static void writeRoadNetwork(Element xmlNode, RoadNetwork primitive, URL geometryURL,
			MapMetricProjection mapProjection, URL attributeURL, XMLBuilder builder,
			PathBuilder pathBuilder, XMLResources resources); static void readRoadNetwork(Element xmlNode, RoadNetwork primitive, PathBuilder pathBuilder,
			XMLResources resources); static StandardRoadNetwork readRoadNetwork(Element xmlNode, PathBuilder pathBuilder,
			XMLResources resources); static final String NODE_ROAD; static final String ATTR_HEIGHT; }
@Test public void readRoadSegmentElementPathBuilderXMLResources() throws Exception { URL xmlFile = Resources.getResource(XMLRoadUtilTest.class, "polyline.xml"); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document doc; try (InputStream is = xmlFile.openStream()) { doc = builder.parse(is); } PathBuilder pathBuilder = new SimplePathBuilder(); XMLResources res = new XMLResources(pathBuilder); RoadSegment polyline = XMLRoadUtil.readRoadSegment(doc.getDocumentElement(), pathBuilder, res); Point2d p; Iterator<Point2d> pts = polyline.pointIterator(); p = pts.next(); assertEpsilonEquals(1., p.getX()); assertEpsilonEquals(2., p.getY()); p = pts.next(); assertEpsilonEquals(-3., p.getX()); assertEpsilonEquals(4., p.getY()); p = pts.next(); assertEpsilonEquals(5., p.getX()); assertEpsilonEquals(-6., p.getY()); assertFalse(pts.hasNext()); assertEquals("name1", polyline.getName()); assertEquals(ColorNames.getColorFromName("orange").intValue(), polyline.getAttribute("color", 0xFFFFFF)); assertEquals("Text", polyline.getAttribute("attr1", (String) null)); }