@Test
public void testReadCharArray() throws IOException {

    Reader reader = new StringReader(source);
    CharToSpaceReader mapReader = new CharToSpaceReader(reader, chars);
    try {
        char[] buffer = new char[expected.length()];
        int numRead = mapReader.read(buffer);
        assertEquals(expected.length(), numRead);
        for (int i = 0; i < expected.length(); i++) {
            assertEquals(expected.charAt(i), buffer[i]);
        }
    } finally {
        mapReader.close();
    }
}