### Question:
JsonIsochronesRequestProcessor extends AbstractHttpRequestProcessor { public static BBox constructIsochroneBBox(Envelope env){ BBox bbox = new BBox(0,0,0,0); if (Double.isFinite(env.getMinX())) bbox.minLon = env.getMinX(); if (Double.isFinite(env.getMinY())) bbox.minLat = env.getMinY(); if (Double.isFinite(env.getMaxX())) bbox.maxLon = env.getMaxX(); if (Double.isFinite(env.getMaxY())) bbox.maxLat = env.getMaxY(); if (!bbox.isValid()) bbox = new BBox(0, 0, 0, 0); return bbox; } JsonIsochronesRequestProcessor(HttpServletRequest request); @Override void process(HttpServletResponse response); static BBox constructIsochroneBBox(Envelope env);  }### Answer:
@Test public void constructNegativeIsochroneBBoxTest() { BBox bbox = JsonIsochronesRequestProcessor.constructIsochroneBBox(negativeEnv); BBox expectedBBox = new BBox(-77.033874, -77.025082, -12.127332, -12.120505); Assert.assertTrue(bbox.isValid()); Assert.assertEquals(expectedBBox.maxLat, bbox.maxLat, 0.0); Assert.assertEquals(expectedBBox.maxLon, bbox.maxLon, 0.0); Assert.assertEquals(expectedBBox.minLat, bbox.minLat, 0.0); Assert.assertEquals(expectedBBox.minLon, bbox.minLon, 0.0); Assert.assertEquals(Double.NaN, bbox.minEle, 0.0); Assert.assertEquals(Double.NaN, bbox.maxEle, 0.0); }
@Test public void constructPositiveIsochroneBBoxTest() { BBox bbox = JsonIsochronesRequestProcessor.constructIsochroneBBox(positiveEnv); BBox expectedBBox = new BBox(2.288033, 2.304801, 48.854886, 48.864247); Assert.assertTrue(bbox.isValid()); Assert.assertEquals(expectedBBox.maxLat, bbox.maxLat, 0.0); Assert.assertEquals(expectedBBox.maxLon, bbox.maxLon, 0.0); Assert.assertEquals(expectedBBox.minLat, bbox.minLat, 0.0); Assert.assertEquals(expectedBBox.minLon, bbox.minLon, 0.0); Assert.assertEquals(Double.NaN, bbox.minEle, 0.0); Assert.assertEquals(Double.NaN, bbox.maxEle, 0.0); }
@Test public void constructMixedIsochroneBBoxTest() { BBox bbox = JsonIsochronesRequestProcessor.constructIsochroneBBox(mixedEnv); BBox expectedBBox = new BBox(18.395489, 18.409940, -33.909040, -33.897771); Assert.assertTrue(bbox.isValid()); Assert.assertEquals(expectedBBox.maxLat, bbox.maxLat, 0.0); Assert.assertEquals(expectedBBox.maxLon, bbox.maxLon, 0.0); Assert.assertEquals(expectedBBox.minLat, bbox.minLat, 0.0); Assert.assertEquals(expectedBBox.minLon, bbox.minLon, 0.0); Assert.assertEquals(Double.NaN, bbox.minEle, 0.0); Assert.assertEquals(Double.NaN, bbox.maxEle, 0.0); }