### Question:
OpenNlpLabelTokenizer implements LabelTokenizer { @Override public String[] tokenize(String label, String language) { if(label == null){ throw new IllegalArgumentException("The parsed Label MUST NOT be NULL!"); } if(languageConfig.isLanguage(language)){ String modelName = languageConfig.getParameter(language, PARAM_MODEL); if(modelName != null){ try { TokenizerModel model = openNlp.getModel(TokenizerModel.class, modelName, null); return new TokenizerME(model).tokenize(label); } catch (Exception e) { log.warn("Unable to load configured TokenizerModel '"+modelName + "' for language '"+language + "! Fallback to default Tokenizers",e); } } return openNlp.getTokenizer(language).tokenize(label); } else { return null; } } OpenNlpLabelTokenizer();  OpenNlpLabelTokenizer(OpenNLP openNLP); @Override String[] tokenize(String label, String language); static final String PARAM_MODEL; }### Answer:
@Test(expected=IllegalArgumentException.class) public void testNullLabel(){ tokenizer.tokenize(null, "en"); }
@Test public void testNullLanguage(){ String[] tokens = tokenizer.tokenize(label, null); Assert.assertNotNull(tokens); Assert.assertArrayEquals(expected, tokens); }
@Test public void testTokenizer(){ String[] tokens = tokenizer.tokenize(label, "en"); Assert.assertNotNull(tokens); Assert.assertArrayEquals(expected, tokens); }
@Test public void testEmptyLabel(){ String[] tokens = tokenizer.tokenize("", "en"); Assert.assertNotNull(tokens); Assert.assertTrue(tokens.length == 0); }