### Question:
SimpleComparableCharSequence implements ComparableCharSequence { @Override public ComparableCharSequence subSequence(final int start, final int end) { if (end > length) { throw new ArrayIndexOutOfBoundsException(end); } if (start < 0) { throw new ArrayIndexOutOfBoundsException(start); } return new SimpleComparableCharSequence(value, this.start + start, end - start); } SimpleComparableCharSequence(final char[] value);  SimpleComparableCharSequence(final char[] value, final int start, final int length); @Override int length(); @Override char charAt(final int index); @Override ComparableCharSequence subSequence(final int start, final int end); @Override int compareTo(final CharSequence other); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString();  }### Answer:
@Test public void testSubSequence() throws Exception { SimpleComparableCharSequence seq = new SimpleComparableCharSequence("abcd".toCharArray(), 0, 4); assertEquals("a", seq.subSequence(0, 1).toString()); assertEquals("ab", seq.subSequence(0, 2).toString()); assertEquals("bc", seq.subSequence(1, 3).toString()); assertEquals("d", seq.subSequence(3, 4).toString()); assertEquals("", seq.subSequence(0, 0).toString()); assertEquals("", seq.subSequence(1, 1).toString()); assertEquals("", seq.subSequence(4, 4).toString()); }