@@ -0,0 +1,1183 @@
+package org.codehaus.httpcache4j.payload;%0A%0Aimport com.google.common.base.Charsets;%0Aimport com.google.common.io.ByteStreams;%0Aimport org.codehaus.httpcache4j.MIMEType;%0Aimport org.junit.Test;%0A%0Aimport java.io.IOException;%0A%0Aimport static org.junit.Assert.*;%0A%0Apublic class PayloadTest %7B%0A%0A    @Test%0A    public void generateByteArrayFromString() throws IOException %7B%0A        String s = String.format(%22abcdefghijklmnopqrstuvwxyz%25s%25s%25s1234567890%22, (char)0x00E6, (char)0x00F8, (char)0x00E5);%0A%0A        ByteArrayPayload bytes = new ByteArrayPayload(s.getBytes(Charsets.UTF_8), MIMEType.APPLICATION_OCTET_STREAM);%0A        assertEquals(42L, bytes.length());%0A        assertEquals(s, new String(ByteStreams.toByteArray(bytes.getInputStream()), Charsets.UTF_8));%0A    %7D%0A%0A    @Test%0A    public void generateFromString() throws IOException %7B%0A        String s = String.format(%22abcdefghijklmnopqrstuvwxyz%25s%25s%25s1234567890%22, (char)0x00E6, (char)0x00F8, (char)0x00E5);%0A%0A        StringPayload bytes = new StringPayload(s, MIMEType.APPLICATION_OCTET_STREAM);%0A        assertEquals(42L, bytes.length());%0A        assertEquals(s, new String(ByteStreams.toByteArray(bytes.getInputStream()), Charsets.UTF_8));%0A    %7D%0A%7D%0A

Add test to calculate the length and correctness of byte array payloads.