@Test
public void testQueryWrappingWGS84() throws Exception {

    ReferencedEnvelope wgs84Envelope = new ReferencedEnvelope(-190, 60, -90, 45, WGS84);
    ProjectionHandler handler = ProjectionHandlerFinder.getHandler(wgs84Envelope, WGS84, true);
    assertNull(handler.validAreaBounds);
    List<ReferencedEnvelope> envelopes = handler.getQueryEnvelopes();
    assertEquals(2, envelopes.size());
    ReferencedEnvelope expected = new ReferencedEnvelope(170, 180, -90, 45, WGS84);
    assertTrue(envelopes.remove(wgs84Envelope));
    assertEquals(expected, envelopes.get(0));
}