*/
@Test
public void shouldWriteEntityWithGeoSphereWithMetricDistanceCorrectly() {
ClassWithGeoSphere object = new ClassWithGeoSphere();
Sphere sphere = new Sphere(new Point(1, 2), new Distance(3, Metrics.KILOMETERS));
Distance radius = sphere.getRadius();
object.sphere = sphere;
DBObject dbo = new BasicDBObject();
converter.write(object, dbo);
assertThat(dbo, is(notNullValue()));
assertThat(dbo.get("sphere"), is(instanceOf(DBObject.class)));
assertThat(
dbo.get("sphere"),
is((Object) new BasicDBObject("center", new BasicDBObject("x", sphere.getCenter().getX()).append("y", sphere
.getCenter().getY())).append("radius", radius.getNormalizedValue()).append("metric",
radius.getMetric().toString())));
}