public static void assertSerializationEquals(final String witness,
			final Object obj, final int[] skip, final int endCompare)
			throws Exception {
		ByteArrayOutputStream memOut = new ByteArrayOutputStream();
		ObjectOutputStream objOut = new ObjectOutputStream(memOut);
		objOut.writeObject(obj);
		objOut.close();

		assertStreamEquals(witness, memOut.toByteArray(), skip, endCompare);
	}
Checks the serialization of an object against an file containing the
expected serialization.

@param witness
           name of file containing expected serialization.
@param obj
           object to be serialized.
@param skip
           positions in serialized stream that should not be compared.
@param endCompare
           position to stop comparison.
@throws Exception
            thrown on IO or serialization exception.
olv-core/src/test/java/pl/otros/logview/accept/query/org/apache/log4j/util/SerializationTestHelper.java