public void testResize() {
   CharTermAttributeImpl t = new CharTermAttributeImpl();
   char[] content = "hello".toCharArray();
   t.copyBuffer(content, 0, content.length);
   for (int i = 0; i < 2000; i++) {
     t.resizeBuffer(i);
     assertTrue(i <= t.buffer().length);
     assertEquals("hello", t.toString());
   }
 }