    @Test
    public void testNormalizedBufferReset() throws Exception {

        int numChars = 2000;
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < numChars; i++) {
            sb.append((char)((int)'a' + (i % 10)));
        }
        
        // We should get 3(N - 1) ngrams
        int numNGrams = 0;
        TextTokenizer tokenizer = new TextTokenizer(sb.toString(), 3);
        while (tokenizer.hasNext()) {
            tokenizer.next();
            numNGrams += 1;
        }
        
        // Tokenizer adds a space at the beginning and end, so it's (numChars + 2)
        assertEquals(3 * ((numChars + 2) - 1), numNGrams);
    }