MutableCharArray implements CharSequence, Cloneable { public final char charAt(final int index) { if (index < 0 || index >= length) { throw new IndexOutOfBoundsException(); } return buffer[start + index]; } MutableCharArray();  MutableCharArray(CharSequence seq);  MutableCharArray(char[] buffer);  MutableCharArray(char[] buffer, int start, int length); void reset(CharSequence seq); void reset(char[] buffer); void reset(char[] buffer, int start, int length); char[] getBuffer(); int getStart(); final char charAt(final int index); int length(); MutableCharArray subSequence(int start, int end); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object other); static final int hashCode(final char[] buffer, int start, int length); MutableCharArray clone(); char[] toArray();  }
@Test public void testCharAt() { final MutableCharArray seq = new MutableCharArray("Dawid Weiss".toCharArray(), 1, 3); assertEquals('a', seq.charAt(0)); assertEquals('w', seq.charAt(1)); assertEquals('i', seq.charAt(2)); }
@Test(expected = IndexOutOfBoundsException.class) public void testCharAtOutOfBounds() { final MutableCharArray seq = new MutableCharArray("Dawid Weiss".toCharArray(), 1, 3); assertEquals('-', seq.charAt(3)); }