public void testProcessNextBlock() {
        byte[] originalBuf = MESSAGE.getBytes();
        byte[] encodedBuf = new byte[originalBuf.length];
        System.arraycopy(originalBuf, 0, encodedBuf, 0, originalBuf.length);
        
        XsDataCoder coder = new XsDataCoder();
        for(int processed = 0; processed < originalBuf.length;) {
            final int offset = processed;
            final int length;
            if( (offset + 5) > originalBuf.length ) {
                length = (originalBuf.length - offset);
            } else {
                length = 5;
            }
            coder.processNextBlock(encodedBuf, offset, length);
            processed += length;
        }
        
        // check that all bytes have been encoded
        for (int i = 0; i < encodedBuf.length; i++) {
            if(encodedBuf[i] == originalBuf[i]) {
                fail("some bytes are not encoded");
            }
        }
        
        
        // now attempt to decode it again

        XsDataCoder decoder = new XsDataCoder();
        byte[] decodedBuf = new byte[encodedBuf.length];
        System.arraycopy(encodedBuf, 0, decodedBuf, 0, encodedBuf.length);
        
        for(int processed = 0; processed < encodedBuf.length;) {
            final int offset = processed;
            final int length;
            if( (offset + 5) > encodedBuf.length ) {
                length = (encodedBuf.length - offset);
            } else {
                length = 5;
            }
            decoder.processNextBlock(decodedBuf, offset, length);
            processed += length;
        }
        
        // check that each byte is back to the original state
        for (int i = 0; i < decodedBuf.length; i++) {
            assertEquals(originalBuf[i], decodedBuf[i]);
        }
        
        
    }