Charray implements CharSequence, Cloneable, Appendable { @Override public Charray subSequence(int start, int end) { return new Charray(Arrays.copyOfRange(chars, start + offset, end + offset)); } Charray();  Charray(int initialCapacity);  Charray(char... chars);  Charray(char[] chars, int start, int end);  Charray(String str);  Charray(String str, int start, int end);  Charray(CharSequence csq);  Charray(CharSequence csq, int start, int end); boolean isEmpty(); @Override int length(); @Override char charAt(int index); char get(int index); void set(int index, char c); void replaceAll(char c, char replacement); @Override Charray append(CharSequence csq); @Override Charray append(CharSequence csq, int start, int end); @Override Charray append(char c); Charray append(String str); Charray append(String str, int start, int end); Charray append(Object o); Charray append(Charray cha); Charray append(Charray cha, int start, int end); Charray append(char[] array); Charray append(char[] array, int start, int end); boolean contains(char c); int indexOf(char c); int indexOfFirst(char... ch); boolean equalsIgnoreCase(CharSequence csq); boolean contentEquals(CharSequence csq); boolean contentEquals(char[] array); boolean contentEquals(Charray cha); boolean startsWith(CharSequence cs); @Override Charray subSequence(int start, int end); Charray sub(int start, int end); Charray sub(int start); void trim(); Charray trimmed(); CharacterInput asInput(); CharacterOutput asOutput(); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); @Override Charray clone();  }
@Test void testSubSequence() { Charray result = a.subSequence(0, 1); assertEquals(a, result); Charray cha = new Charray("abcdefg"); Charray sub = cha.subSequence(2, 4); assertEquals("cd", sub.toString()); assertEquals('c', sub.get(0)); assertEquals('d', sub.get(1)); sub.set(0, '!'); assertEquals('!', sub.get(0)); assertEquals('c', cha.get(2)); cha.set(3, '?'); assertEquals('?', cha.get(3)); assertEquals('c', sub.get(1)); }