@Test(expected=IllegalArgumentException.class)
public void testValidatePageSegMode() {

    TesseractOCRConfig config = new TesseractOCRConfig();
    config.setPageSegMode("0");
    config.setPageSegMode("10");
    assertTrue("Couldn't set valid values", true);
    config.setPageSegMode("14");
}