@Test
public void testSortByDistanceInMeters()
{

	List<Position> actual;
	List<Position> expected;
	List<Position> geohashes = ListFactory.newArrayList();
	geohashes.add(new GeoHashPoint("u0vf2w1s5tsy"));
	geohashes.add(new GeoHashPoint("u0t3z7cnznrx"));
	geohashes.add(new GeoHashPoint("u0td0v9xnz28"));
	Position startPoint = new GeoHashPoint("u11fyhzqhp3c");
	actual = LocationExtensions.sortByDistanceInMeters(startPoint, geohashes);
	expected = ListFactory.newArrayList(new GeoHashPoint("u0vf2w1s5tsy"),
		new GeoHashPoint("u0td0v9xnz28"), new GeoHashPoint("u0t3z7cnznrx"));
	for (int i = 0; i < actual.size(); i++)
	{
		assertEquals(expected.get(i), actual.get(i));
	}
	geohashes = ListFactory.newArrayList();
	geohashes.add(new GeoHashPoint("u0z4")); // below Wuerzburg
	geohashes.add(new GeoHashPoint("u1p1")); // right from Bad Hersfeld
	geohashes.add(new GeoHashPoint("u28j")); // Ingolstadt
	geohashes.add(new GeoHashPoint("u0zc4wp0k")); // Nurremberg at work
	startPoint = new GeoHashPoint("u0ww"); // Ludwigsburg
	actual = LocationExtensions.sortByDistanceInMeters(startPoint, geohashes);
	expected = ListFactory.newArrayList(new GeoHashPoint(49.658203125d, 10.01953125d),
		new GeoHashPoint(49.42755460739136d, 11.018106937408447d),
		new GeoHashPoint(48.779296875d, 11.42578125d),
		new GeoHashPoint(50.888671875d, 10.01953125d));
	for (int i = 0; i < actual.size(); i++)
	{
		assertEquals(expected.get(i), actual.get(i));
	}
}