public static byte[] serialize(final Object body) throws IOException {
        final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        final ObjectOutputStream outputStream = new ObjectOutputStream(byteArrayOutputStream);

        try {
            outputStream.writeObject(body);
            return byteArrayOutputStream.toByteArray();
        } catch (NotSerializableException exception) {
            throw new RuntimeCamelException(exception);
        } finally {
            byteArrayOutputStream.close();
            outputStream.close();
        }
    }
@Test
    public void testSerializationOfString() throws Exception {
        String in = "Hello World!";

        byte[] expected = PulsarMessageUtils.serialize(in);

        assertNotNull(expected);
    }