private void roundtrip(Object in) throws Exception { BaseProtoStreamMarshaller marshaller = makeInstance(); assertTrue(marshaller.isMarshallable(in)); byte[] buffer = marshaller.objectToByteBuffer(in); assertNotNull(buffer); Object out = marshaller.objectFromByteBuffer(buffer); assertNotNull(out); assertEquals(in.getClass(), out.getClass()); if (in instanceof byte[]) { assertArrayEquals((byte[]) in, (byte[]) out); } else { assertEquals(in, out); } }