### Question:
ClassificationValidationUtils { public static void validateParamsModelToLoad(final MachineLearningModelLoader modelLoader, final Path modelPath, final DatasetSchema schema, final Map<String, String> params) throws ModelLoadingException { Preconditions.checkNotNull(modelLoader, "modelLoader cannot be null"); Preconditions.checkNotNull(modelPath, "modelPath cannot be null"); Preconditions.checkNotNull(schema, "schema cannot be null"); Preconditions.checkNotNull(params, "params cannot be null"); logger.debug("Validating the parameters of the model in path [{}]", modelPath); final List<ParamValidationError> validationErrors = modelLoader.validateForLoad( modelPath, schema, params ); if (!validationErrors.isEmpty()) { final String errorMsg = validationErrors.stream() .map(ParamValidationError::getMessage) .collect(Collectors.joining(",")); throw new ModelLoadingException(errorMsg); } logger.debug("Parameters of the model in path [{}] successfully validated", modelPath); } private  ClassificationValidationUtils(); static void validateClassificationModel(final DatasetSchema schema,
                                                   final ClassificationMLModel model); static void validateParamsModelToLoad(final MachineLearningModelLoader modelLoader,
                                                 final Path modelPath,
                                                 final DatasetSchema schema,
                                                 final Map<String, String> params);  }### Answer:
@Test public void testValidParamsModelToLoad() { assertThatCode( () -> ClassificationValidationUtils.validateParamsModelToLoad( getMachineLearningModelLoader(), VALID_PATH, SCHEMA, VALID_PARAM_MAP )) .doesNotThrowAnyException(); }
@Test public void testInvalidParamsModelToLoad() { assertThatThrownBy( () -> ClassificationValidationUtils.validateParamsModelToLoad( getMachineLearningModelLoader(), VALID_PATH, SCHEMA, INVALID_PARAM_MAP )) .isInstanceOf(ModelLoadingException.class) .hasMessage(INVALID_MODEL_TO_LOAD_MSG); }
@Test public void testVoidModelLoaderOfModelToLoad() { assertThatThrownBy( () -> ClassificationValidationUtils.validateParamsModelToLoad( null, VALID_PATH, SCHEMA, VALID_PARAM_MAP )) .isInstanceOf(NullPointerException.class) .hasMessageContaining(NULL_ERROR_MSG); }
@Test public void testVoidPathOfModelToLoad() { assertThatThrownBy( () -> ClassificationValidationUtils.validateParamsModelToLoad( getMachineLearningModelLoader(), null, SCHEMA, VALID_PARAM_MAP )) .isInstanceOf(NullPointerException.class) .hasMessageContaining(NULL_ERROR_MSG); }
@Test public void testVoidSchemaOfModelToLoad() { assertThatThrownBy( () -> ClassificationValidationUtils.validateParamsModelToLoad( getMachineLearningModelLoader(), VALID_PATH, null, VALID_PARAM_MAP )) .isInstanceOf(NullPointerException.class) .hasMessageContaining(NULL_ERROR_MSG); }
@Test public void testVoidParamOfModelToLoad() { assertThatThrownBy( () -> ClassificationValidationUtils.validateParamsModelToLoad( getMachineLearningModelLoader(), VALID_PATH, SCHEMA, null )) .isInstanceOf(NullPointerException.class) .hasMessageContaining(NULL_ERROR_MSG); }