### Question:
MatrixRequestHandler { protected static int convertToMatrixProfileType(APIEnums.Profile profile) throws ParameterValueException { try { int profileFromString = RoutingProfileType.getFromString(profile.toString()); if (profileFromString == 0) { throw new ParameterValueException(MatrixErrorCodes.INVALID_PARAMETER_VALUE, MatrixRequest.PARAM_PROFILE); } return profileFromString; } catch (Exception e) { throw new ParameterValueException(MatrixErrorCodes.INVALID_PARAMETER_VALUE, MatrixRequest.PARAM_PROFILE); } } 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 convertToProfileTypeTest() throws ParameterValueException { Assert.assertEquals(1, MatrixRequestHandler.convertToMatrixProfileType(APIEnums.Profile.DRIVING_CAR)); Assert.assertEquals(2, MatrixRequestHandler.convertToMatrixProfileType(APIEnums.Profile.DRIVING_HGV)); Assert.assertEquals(10, MatrixRequestHandler.convertToMatrixProfileType(APIEnums.Profile.CYCLING_REGULAR)); Assert.assertEquals(12, MatrixRequestHandler.convertToMatrixProfileType(APIEnums.Profile.CYCLING_ROAD)); Assert.assertEquals(11, MatrixRequestHandler.convertToMatrixProfileType(APIEnums.Profile.CYCLING_MOUNTAIN)); Assert.assertEquals(17, MatrixRequestHandler.convertToMatrixProfileType(APIEnums.Profile.CYCLING_ELECTRIC)); Assert.assertEquals(20, MatrixRequestHandler.convertToMatrixProfileType(APIEnums.Profile.FOOT_WALKING)); Assert.assertEquals(21, MatrixRequestHandler.convertToMatrixProfileType(APIEnums.Profile.FOOT_HIKING)); Assert.assertEquals(30, MatrixRequestHandler.convertToMatrixProfileType(APIEnums.Profile.WHEELCHAIR)); }
@Test(expected = ParameterValueException.class) public void convertToWrongMatrixProfileTypeTest() throws ParameterValueException { MatrixRequestHandler.convertToMatrixProfileType(APIEnums.Profile.forValue("foo")); }