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