ConvertLatLon { public static final GeometryWrapper toGeometryWrapper(Node latNode, Node lonNode) { double lat = extractDouble(NodeValue.makeNode(latNode)); double lon = extractDouble(NodeValue.makeNode(lonNode)); checkBounds(lat, lon); return GeometryWrapper.fromPoint(lat, lon, SRS_URI.WGS84_CRS); }  static final Literal toLiteral(double lat, double lon); static final String toWKT(double lat, double lon); static final NodeValue toNodeValue(NodeValue latNodeValue, NodeValue lonNodeValue); static double extractDouble(NodeValue nodeValue); static final Node toNode(Node latNode, Node lonNode); static final GeometryWrapper toGeometryWrapper(Node latNode, Node lonNode); static final void checkBounds(double latitude, double longitude);  }
@Test public void testConvertToGeometryWrapper_NodeString_NodeString() { Node n1 = NodeValue.makeString("10.0").asNode(); Node n2 = NodeValue.makeString("20").asNode(); GeometryWrapper expResult = GeometryWrapper.extract("<http: GeometryWrapper result = ConvertLatLon.toGeometryWrapper(n1, n2); assertEquals(expResult, result); }
@Test(expected = DatatypeFormatException.class) public void testConvertToGeometryWrapper_NodeString_NodeString_Malformed() { Node n1 = NodeValue.makeString("val").asNode(); Node n2 = NodeValue.makeString("20.0").asNode(); GeometryWrapper expResult = GeometryWrapper.extract("<http: GeometryWrapper result = ConvertLatLon.toGeometryWrapper(n1, n2); assertEquals(expResult, result); }