@Test
public void testQueryWrappingMercatorSeparate() throws Exception {
ReferencedEnvelope world = new ReferencedEnvelope(160, 180, -40, 40, WGS84);
ReferencedEnvelope mercatorEnvelope = world.transform(MERCATOR, true);
// move it so that it crosses the dateline
mercatorEnvelope.translate(mercatorEnvelope.getWidth() / 2, 0);
// get query area, we expect two separate query envelopes
ProjectionHandler handler = ProjectionHandlerFinder.getHandler(mercatorEnvelope, WGS84, true);
List<ReferencedEnvelope> envelopes = handler.getQueryEnvelopes();
assertEquals(2, envelopes.size());