@Test
public void testGrowPoint() {

    LOG.info("testGrowPoint");
    final GeoRectangle a1 = new GeoRectangle(new GeoPoint(0.0, 150.0), new GeoPoint(2.0, 160.0));
    final GeoRectangle a2 = new GeoRectangle(new GeoPoint(0.0, -160.0), new GeoPoint(2.0, -150.0));
    final GeoRectangle a3 = new GeoRectangle(new GeoPoint(0.0, 160.0), new GeoPoint(2.0, -160.0));
    final GeoPoint p1 = new GeoPoint(1.0, 170.0);
    final GeoPoint p2 = new GeoPoint(1.0, -170.0);
    final GeoPoint p3 = new GeoPoint(1.0, 150.0);
    final GeoPoint p4 = new GeoPoint(1.0, -150.0);
    Assert.assertEquals(new GeoRectangle(new GeoPoint(0.0, 150.0), new GeoPoint(2.0, 170.0)), a1.grow(p1));
    Assert.assertEquals(new GeoRectangle(new GeoPoint(0.0, 150.0), new GeoPoint(2.0, -170.0)), a1.grow(p2));
    Assert.assertEquals(new GeoRectangle(new GeoPoint(0.0, 170.0), new GeoPoint(2.0, -150.0)), a2.grow(p1));
    Assert.assertEquals(new GeoRectangle(new GeoPoint(0.0, -170.0), new GeoPoint(2.0, -150.0)), a2.grow(p2));
    Assert.assertEquals(new GeoRectangle(new GeoPoint(0.0, 160.0), new GeoPoint(2.0, -160.0)), a3.grow(p1));
    Assert.assertEquals(new GeoRectangle(new GeoPoint(0.0, 160.0), new GeoPoint(2.0, -160.0)), a3.grow(p2));
    Assert.assertEquals(new GeoRectangle(new GeoPoint(0.0, 150.0), new GeoPoint(2.0, -160.0)), a3.grow(p3));
    Assert.assertEquals(new GeoRectangle(new GeoPoint(0.0, 160.0), new GeoPoint(2.0, -150.0)), a3.grow(p4));
    // Non-wrapped rectangle. Try all points in and outside.
    final GeoPoint p5 = new GeoPoint(1.0, 151.0);
    final GeoPoint p6 = new GeoPoint(-1.0, 151.0);
    final GeoPoint p7 = new GeoPoint(0.0, 149.0);
    final GeoPoint p8 = new GeoPoint(1.0, 161.0);
    final GeoPoint p9 = new GeoPoint(3.0, 159.0);
    Assert.assertEquals(new GeoRectangle(new GeoPoint(0.0, 150.0), new GeoPoint(2.0, 160.0)), a1.grow(p5));
    Assert.assertEquals(new GeoRectangle(new GeoPoint(-1.0, 150.0), new GeoPoint(2.0, 160.0)), a1.grow(p6));
    Assert.assertEquals(new GeoRectangle(new GeoPoint(0.0, 149.0), new GeoPoint(2.0, 160.0)), a1.grow(p7));
    Assert.assertEquals(new GeoRectangle(new GeoPoint(0.0, 150.0), new GeoPoint(2.0, 161.0)), a1.grow(p8));
    Assert.assertEquals(new GeoRectangle(new GeoPoint(0.0, 150.0), new GeoPoint(3.0, 160.0)), a1.grow(p9));
    // Wrapped rectangle. Try all points in and outside.
    final GeoPoint p10 = new GeoPoint(1.0, 161.0);
    final GeoPoint p11 = new GeoPoint(1.0, -161.0);
    final GeoPoint p12 = new GeoPoint(1.0, 159.0);
    final GeoPoint p13 = new GeoPoint(-1.0, 161.0);
    final GeoPoint p14 = new GeoPoint(1.0, -159.0);
    final GeoPoint p15 = new GeoPoint(3.0, -161.0);
    Assert.assertEquals(new GeoRectangle(new GeoPoint(0.0, 160.0), new GeoPoint(2.0, -160.0)), a3.grow(p10));
    Assert.assertEquals(new GeoRectangle(new GeoPoint(0.0, 160.0), new GeoPoint(2.0, -160.0)), a3.grow(p11));
    Assert.assertEquals(new GeoRectangle(new GeoPoint(0.0, 159.0), new GeoPoint(2.0, -160.0)), a3.grow(p12));
    Assert.assertEquals(new GeoRectangle(new GeoPoint(-1.0, 160.0), new GeoPoint(2.0, -160.0)), a3.grow(p13));
    Assert.assertEquals(new GeoRectangle(new GeoPoint(0.0, 160.0), new GeoPoint(2.0, -159.0)), a3.grow(p14));
    Assert.assertEquals(new GeoRectangle(new GeoPoint(0.0, 160.0), new GeoPoint(3.0, -160.0)), a3.grow(p15));
}