CharsCharSequence implements CharSequence { public char[] toCharArray() { return Arrays.copyOfRange(chars, start, end); } CharsCharSequence(char[] chars);  CharsCharSequence(char[] chars, int start, int end); @Override int length(); @Override char charAt(int index); @Override CharSequence subSequence(int start, int end); char[] toCharArray(); char[] subChars(int start, int end);  }
@Test public void test_3() throws Exception{ CharsCharSequence seq = new CharsCharSequence("hello".toCharArray(), 1, 3); char[] a = seq.toCharArray(); Assert.assertEquals(2, a.length); Assert.assertEquals('e', a[0]); Assert.assertEquals('l', a[1]); }