GeoRectangle extends Primitive { @Nonnull @Override public GeoRectangle translate(@Nonnull final GeoVector vector) { return new GeoRectangle(southWest.translate(vector), northEast.translate(vector)); } GeoRectangle(
            @Nonnull final GeoPoint southWest,
            @Nonnull final GeoPoint northEast); @SuppressWarnings({"ConstantConditions", "UnusedDeclaration"}) @Deprecated private  GeoRectangle(); @Deprecated() @Nonnull static GeoRectangle getWorld(); @Nonnull @Override GeoRectangle boundingBox(); @Nonnull GeoPoint getSouthWest(); @Nonnull GeoPoint getNorthEast(); @Nonnull GeoRectangle withSouthWest(@Nonnull final GeoPoint southWest); @Nonnull GeoRectangle withNorthEast(@Nonnull final GeoPoint northEast); double getNorthing(); double getEasting(); @Override boolean overlaps(@Nonnull final GeoArea area); @Nonnull GeoRectangle expand(final double meters); @Override boolean contains(@Nonnull final GeoArea area); @Override boolean contains(@Nonnull final GeoPoint point); @Nonnull @Override GeoRectangle translate(@Nonnull final GeoVector vector); @Nonnull @Override GeoRectangle moveTo(@Nonnull final GeoPoint origin); @Override @Nonnull Collection<GeoRectangle> pixelate(); @Nonnull GeoRectangle grow(@Nonnull final GeoPoint point); @Nonnull GeoRectangle grow(@Nonnull final GeoRectangle other); boolean isWrapped(); @Override boolean canEqual(@Nonnull final Object obj); @Override boolean equals(@Nullable final Object obj); @Override int hashCode(); static final GeoRectangle WORLD; }
@Test public void testTranslate() { LOG.info("testTranslate"); final GeoRectangle a1 = new GeoRectangle(new GeoPoint(0.0, 0.0), new GeoPoint(2.0, 2.0)); final GeoVector p = new GeoVector(1.0, 1.0); final GeoRectangle a2 = a1.translate(p); final GeoPoint p1 = new GeoPoint(1.0, 1.0); final GeoPoint p2 = new GeoPoint(3.0, 3.0); Assert.assertEquals(p1, a2.getSouthWest()); Assert.assertEquals(p2, a2.getNorthEast()); final GeoVector q = new GeoVector(0.0, -181.0); final GeoRectangle a3 = a1.translate(q); final GeoPoint q1 = new GeoPoint(0.0, 179.0); final GeoPoint q2 = new GeoPoint(2.0, -179.0); Assert.assertEquals(q1, a3.getSouthWest()); Assert.assertEquals(q2, a3.getNorthEast()); final GeoVector r = new GeoVector(0.0, 181.0); final GeoRectangle a4 = a1.translate(r); final GeoPoint r1 = new GeoPoint(0.0, -179.0); final GeoPoint r2 = new GeoPoint(2.0, -177.0); Assert.assertEquals(r1, a4.getSouthWest()); Assert.assertEquals(r2, a4.getNorthEast()); }