@Test
public void testGraphQueryGeoPoint() {
graph.prepareVertex("v1", VISIBILITY_A)
.setProperty("location", new GeoPoint(38.9186, -77.2297, "Reston, VA"), VISIBILITY_A)
.save(AUTHORIZATIONS_A_AND_B);
graph.prepareVertex("v2", VISIBILITY_A)
.setProperty("location", new GeoPoint(38.9544, -77.3464, "Reston, VA"), VISIBILITY_A)
.save(AUTHORIZATIONS_A_AND_B);
List<Vertex> vertices = IterableUtils.toList(graph.query(AUTHORIZATIONS_A)
.has("location", GeoCompare.WITHIN, new GeoCircle(38.9186, -77.2297, 1))
.vertices());
Assert.assertEquals(1, IterableUtils.count(vertices));
GeoPoint geoPoint = (GeoPoint) vertices.get(0).getPropertyValue("location");
assertEquals(38.9186, geoPoint.getLatitude(), 0.001);
assertEquals(-77.2297, geoPoint.getLongitude(), 0.001);
assertEquals("Reston, VA", geoPoint.getDescription());
vertices = IterableUtils.toList(graph.query(AUTHORIZATIONS_A)
.has("location", GeoCompare.WITHIN, new GeoCircle(38.9186, -77.2297, 25))
.vertices());
Assert.assertEquals(2, IterableUtils.count(vertices));
vertices = IterableUtils.toList(graph.query(AUTHORIZATIONS_A)
.has("location", TextPredicate.CONTAINS, "Reston")
.vertices());
Assert.assertEquals(2, IterableUtils.count(vertices));
}