void () { String s = "abc.d"; CharBuffer buffer = CharBuffer.allocate(s.length()); buffer.append(s); buffer.rewind(); assertNotNull(CharArrayUtil.fromSequenceWithoutCopying(buffer)); assertNotNull(CharArrayUtil.fromSequenceWithoutCopying(buffer.subSequence(0, 5))); assertNull(CharArrayUtil.fromSequenceWithoutCopying(buffer.subSequence(1, 5))); assertNull(CharArrayUtil.fromSequenceWithoutCopying(buffer.subSequence(1, 2))); }