@Test
public void testInvalidAnchors() throws ImageProcessingException {

    Map config = new LinkedHashMap<>();
    YoloProcessor ypImageSaver = new YoloProcessor();
    // anchorList is too short
    List anchorList = Arrays.asList(0.5);
    config.put("pbFile", PB_FILE);
    config.put("labelFile", LABEL_FILE);
    config.put("anchors", anchorList);
    try {
        ypImageSaver.setupImageProcessing(config, SOURCE_NAME, MODEL_DIRECTORY, testAuthToken, testVantiqServer);
    } catch (Exception e) {
        fail("Should not fail with invalid anchors: " + e.getClass().getName() + "::" + e.getMessage());
    }
    // anchorList is too long
    anchorList = Arrays.asList(1, 3, 6, 4, 4, 5, 7, 4, 9, 0, 9);
    config.remove("anchors");
    config.put("anchors", anchorList);
    try {
        ypImageSaver.setupImageProcessing(config, SOURCE_NAME, MODEL_DIRECTORY, testAuthToken, testVantiqServer);
    } catch (Exception e) {
        fail("Should not fail with invalid anchors: " + e.getClass().getName() + "::" + e.getMessage());
    }
    // anchorList contains non-numbers
    anchorList = Arrays.asList(1, 3, 6, "a", 4, 5, 7, 4, 9, 0);
    config.remove("anchors");
    config.put("anchors", anchorList);
    try {
        ypImageSaver.setupImageProcessing(config, SOURCE_NAME, MODEL_DIRECTORY, testAuthToken, testVantiqServer);
    } catch (Exception e) {
        fail("Should not fail with invalid anchors: " + e.getClass().getName() + "::" + e.getMessage());
    }
}