* serialize to the same bytes seems simpler, on the whole,
* (while still making for a somewhat yucky test). At
* least we encapsulate it off here in its own method so
* the test that uses it remains clear.
*/
final DefaultHttpCacheEntrySerializer ser = new DefaultHttpCacheEntrySerializer();
final ByteArrayOutputStream bos1 = new ByteArrayOutputStream();
ser.writeTo(entry, bos1);
final byte[] bytes1 = bos1.toByteArray();
final ByteArrayOutputStream bos2 = new ByteArrayOutputStream();
ser.writeTo(resultEntry, bos2);
final byte[] bytes2 = bos2.toByteArray();
assertEquals(bytes1.length, bytes2.length);
for(int i = 0; i < bytes1.length; i++) {
assertEquals(bytes1[i], bytes2[i]);
}