### Question:
JSONBasedIndividualMatrixResponse { List<JSON2DDestinations> constructDestinations(MatrixResult matrixResult) { List<JSON2DDestinations> destinations = new ArrayList<>(); for (ResolvedLocation location : matrixResult.getDestinations()) { if (location != null) destinations.add(new JSON2DDestinations(location, includeResolveLocations)); else destinations.add(null); } return destinations; } JSONBasedIndividualMatrixResponse(MatrixRequest request);   }### Answer:
@Test public void constructDestinations() { List<JSON2DDestinations> json2DDestinations = jsonBasedIndividualMatrixResponse.constructDestinations(matrixResult); Assert.assertEquals(1, json2DDestinations.size()); Assert.assertEquals("foo", json2DDestinations.get(0).name); Assert.assertEquals(new Coordinate(8.681495, 49.41461, Double.NaN), json2DDestinations.get(0).location); Double[] location = json2DDestinations.get(0).getLocation(); Assert.assertEquals(2, location.length); Assert.assertEquals(0, location[0].compareTo(8.681495)); Assert.assertEquals(0, location[1].compareTo(49.41461)); }