@Override
    public String[] split(String text) {
        boundary.setText(text);
        List<String> words = new ArrayList<>();
        int start = boundary.first();
        int end = boundary.next();

        while (end != BreakIterator.DONE) {
            String word = text.substring(start, end).trim();
            if (!word.isEmpty()) {
                words.add(word);
            }
            start = end;
            end = boundary.next();
        }

        return words.toArray(new String[0]);
    }
@Test
    public void testSplitAbbreviation() {
        System.out.println("tokenize");
        String text = "Here are some examples of abbreviations: A.B., abbr., "
                + "acad., A.D., alt., A.M., B.C., etc.";

        String[] expResult = {"Here", "are", "some", "examples", "of",
            "abbreviations", ":", "A.B", ".", ",", "abbr", ".", ",", "acad", ".",
            ",", "A.D", ".", ",", "alt", ".", ",", "A.M", ".", ",",
            "B.C", ".", ",", "etc", "."};

        BreakIteratorTokenizer instance = new BreakIteratorTokenizer();
        String[] result = instance.split(text);

        assertEquals(expResult.length, result.length);
        for (int i = 0; i < result.length; i++) {
            assertEquals(expResult[i], result[i]);
        }
    }