@@ -0,0 +1,2545 @@
+package io.xlate.edi.internal.stream;%0A%0Aimport static org.junit.jupiter.api.Assertions.*;%0A%0Aimport java.nio.CharBuffer;%0A%0Aimport org.junit.jupiter.api.BeforeEach;%0Aimport org.junit.jupiter.api.Test;%0A%0Aclass CharArraySequenceTest %7B%0A%0A    CharArraySequence target;%0A%0A    @BeforeEach%0A    public void setUp() %7B%0A        target = new CharArraySequence();%0A    %7D%0A%0A    @Test%0A    void testClear() %7B%0A        char%5B%5D text = %22ANYVALUEEXCEPTTHIS%22.toCharArray();%0A        int start = 3;%0A        int length = 5;%0A        target.set(text, start, length);%0A        assertEquals(5, target.length());%0A        assertEquals(%22VALUE%22, target.toString());%0A        target.clear();%0A        assertEquals(%22%22, target.toString());%0A    %7D%0A%0A    @Test%0A    void testPutToBuffer() %7B%0A        char%5B%5D text = %22ANYVALUEEXCEPTTHIS%22.toCharArray();%0A        int start = 3;%0A        int length = 5;%0A        target.set(text, start, length);%0A        CharBuffer buffer = CharBuffer.allocate(20);%0A        target.putToBuffer(buffer);%0A        buffer.flip();%0A        assertEquals(%22VALUE%22, buffer.toString());%0A    %7D%0A%0A    @Test%0A    void testCharAt() %7B%0A        char%5B%5D text = %22ANYVALUEEXCEPTTHIS%22.toCharArray();%0A        int start = 3;%0A        int length = 5;%0A        target.set(text, start, length);%0A        assertThrows(StringIndexOutOfBoundsException.class, () -%3E target.charAt(-1));%0A        assertEquals('V', target.charAt(0));%0A        assertEquals('E', target.charAt(4));%0A        assertThrows(StringIndexOutOfBoundsException.class, () -%3E target.charAt(5));%0A    %7D%0A%0A    @Test%0A    void testSubSequence() %7B%0A        char%5B%5D text = %22ANYVALUEEXCEPTTHIS%22.toCharArray();%0A        int start = 3;%0A        int length = 5;%0A        target.set(text, start, length);%0A        assertThrows(IndexOutOfBoundsException.class, () -%3E target.subSequence(-10, 3));%0A        assertEquals(%22VALUE%22, target.subSequence(0, 5).toString());%0A        assertEquals(%22VAL%22, target.subSequence(0, 3).toString());%0A        assertEquals(%22ALUE%22, target.subSequence(1, 5).toString());%0A        assertThrows(IndexOutOfBoundsException.class, () -%3E target.subSequence(0, 10));%0A        assertThrows(IndexOutOfBoundsException.class, () -%3E target.subSequence(6, 5));%0A    %7D%0A%0A    @Test%0A    void testCompareTo() %7B%0A        char%5B%5D text = %22ANYVALUEEXCEPTTHIS%22.toCharArray();%0A        int start = 3;%0A        int length = 5;%0A        target.set(text, start, length);%0A        assertEquals(0, target.compareTo(%22VALUE%22));%0A        assertTrue(target.compareTo(%22VALUE1%22) %3C 0);%0A        assertTrue(target.compareTo(%22A%22) %3E 0);%0A        assertTrue(target.compareTo(%22Z%22) %3C 0);%0A    %7D%0A%0A%7D%0A

Test that CharArraySequence functions as expected