### Question:
MatrixRequestHandler { protected static ArrayList<Coordinate> convertIndexToLocations(String[] index, Coordinate[] locations) { ArrayList<Coordinate> indexCoordinates = new ArrayList<>(); for (String indexString : index) { int indexInteger = Integer.parseInt(indexString); indexCoordinates.add(locations[indexInteger]); } return indexCoordinates; } private  MatrixRequestHandler(); static MatrixResult generateMatrixFromRequest(MatrixRequest request); static org.heigit.ors.matrix.MatrixRequest convertMatrixRequest(MatrixRequest request); static int convertMetrics(MatrixRequestEnums.Metrics[] metrics);  }### Answer:
@Test public void convertIndexToLocationsTest() throws Exception { ArrayList<Coordinate> coordinate = MatrixRequestHandler.convertIndexToLocations(new String[]{"1"}, this.coordinates); Assert.assertEquals(8.686507, coordinate.get(0).x, 0); Assert.assertEquals(49.41943, coordinate.get(0).y, 0); Assert.assertEquals(Double.NaN, coordinate.get(0).z, 0); }
@Test(expected = Exception.class) public void convertWrongIndexToLocationsTest() throws Exception { MatrixRequestHandler.convertIndexToLocations(new String[]{"foo"}, this.coordinates); }