// expected
}
}
public void testSimpleAppend() throws Exception {
CharArrayBuffer buffer = new CharArrayBuffer(16);
assertEquals(16, buffer.capacity());
assertEquals(0, buffer.length());
char[] b1 = buffer.toCharArray();
assertNotNull(b1);
assertEquals(0, b1.length);
assertTrue(buffer.isEmpty());
assertFalse(buffer.isFull());
char[] tmp = new char[] { '1', '2', '3', '4'};
buffer.append(tmp, 0, tmp.length);
assertEquals(16, buffer.capacity());
assertEquals(4, buffer.length());
assertFalse(buffer.isEmpty());
assertFalse(buffer.isFull());
char[] b2 = buffer.toCharArray();
assertNotNull(b2);
assertEquals(4, b2.length);
for (int i = 0; i < tmp.length; i++) {
assertEquals(tmp[i], b2[i]);
assertEquals(tmp[i], buffer.charAt(i));
}
assertEquals("1234", buffer.toString());
buffer.clear();
assertEquals(16, buffer.capacity());
assertEquals(0, buffer.length());
assertTrue(buffer.isEmpty());
assertFalse(buffer.isFull());
}