//Fiji is a group of islands crossing the dateline.
String wktStr = readFirstLineFromRsrc("/fiji.wkt.txt");
JtsSpatialContextFactory factory = new JtsSpatialContextFactory();
factory.normWrapLongitude = true;
JtsSpatialContext ctx = factory.newSpatialContext();
Shape shape = ctx.readShapeFromWkt(wktStr);
assertRelation(null,SpatialRelation.CONTAINS, shape,
ctx.makePoint(-179.99,-16.9));
assertRelation(null,SpatialRelation.CONTAINS, shape,
ctx.makePoint(+179.99,-16.9));
assertTrue(shape.getBoundingBox().getWidth() < 5);//smart bbox
System.out.println("Fiji Area: "+shape.getArea(ctx));
}