int size = _documentProperties.getSize();
byte[] buf = new byte[size];
_documentProperties.serialize(buf, 0);
DocumentProperties newDocProperties =
new DocumentProperties(buf, 0);
Field[] fields = DocumentProperties.class.getSuperclass().getDeclaredFields();
AccessibleObject.setAccessible(fields, true);
for (int x = 0; x < fields.length; x++)
{
if (!fields[x].getType().isArray())
{
assertEquals(fields[x].get(_documentProperties),
fields[x].get(newDocProperties));
}
else
{
byte[] buf1 = (byte[])fields[x].get(_documentProperties);
byte[] buf2 = (byte[])fields[x].get(newDocProperties);
Arrays.equals(buf1, buf2);
}
}