@Test
public void testSearch()
{

    GeoMultiTrie<String> trie = new GeoMultiTrie<String>();
    GeoPoint[] points = new GeoPoint[] {
        new GeoPoint(0.0, 0.0),
        new GeoPoint(1.0, 0.0),
        new GeoPoint(2.0, 0.0),
        };
    String[] strings = new String[] {"a", "b", "c"};
    for (GeoPoint p : points)
    {
        for (String s : strings)
        {
            Assert.assertTrue(s + " " + p, trie.add(p, s));
        }
    }
    Iterator<GeoSearchResult<String>> it = trie.search(points[0]);
    for (int distance = 0; distance < points.length; ++distance)
    {
        Set<String> stringsSeen = new HashSet<String>();
        for (int string = 0; string < strings.length; ++string)
        {
            GeoSearchResult<String> result = it.next();
            Assert.assertEquals(
                (double)distance,
                result.distance,
                1e-8);
            Assert.assertEquals(
                points[distance],
                result.point);
            stringsSeen.add(result.value);
        }
        Assert.assertEquals(
            "distance = " + distance,
            strings.length,
            stringsSeen.size());
    }
    Assert.assertFalse(it.hasNext());
}