### Question:
SimpleLabelTokenizer implements LabelTokenizer { @Override public String[] tokenize(String label, String language) { if(label == null){ throw new IllegalArgumentException("The parsed Label MUST NOT be NULL!"); } ArrayList<String> tokens = new ArrayList<String>(); int start = -1; int pc = 0; CT state = CT.WHITESPACE; CT charType = CT.WHITESPACE; for (int i = 0; i < label.length(); i++) { int c = label.codePointAt(i); charType = getType(c); if (state == CT.WHITESPACE) { if (charType != CT.WHITESPACE) { start = i; } } else { if (charType != state || charType == CT.OTHER && c != pc) { tokens.add(label.substring(start, i)); start = i; } } state = charType; pc = c; } if (charType != CT.WHITESPACE) { tokens.add(label.substring(start, label.length())); } return tokens.toArray(new String[tokens.size()]); }  @Override String[] tokenize(String label, String language);  }### Answer:
@Test(expected=IllegalArgumentException.class) public void testNullLabel(){ tokenizer.tokenize(null, "en"); }
@Test public void testNullLanguate(){ 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); }