@Test
	public void testHeaderEmbedding() throws Exception {
		EmbeddedHeadersMessageConverter converter = new EmbeddedHeadersMessageConverter();
		Message<byte[]> message = MessageBuilder.withPayload("Hello".getBytes())
				.setHeader("foo", "bar")
				.setHeader("baz", "quxx")
				.build();
		byte[] embedded = converter.embedHeaders(new MessageValues(message), "foo", "baz");
		assertEquals(0xff, embedded[0] & 0xff);
		assertEquals("\u0002\u0003foo\u0000\u0000\u0000\u0005\"bar\"\u0003baz\u0000\u0000\u0000\u0006\"quxx\"Hello",
				new String(embedded).substring(1));

		MessageValues extracted = converter.extractHeaders(MessageBuilder.withPayload(embedded).build(), false);
		assertEquals("Hello", new String((byte[])extracted.getPayload()));
		assertEquals("bar", extracted.get("foo"));
		assertEquals("quxx", extracted.get("baz"));
	}
@author Gary Russell
@author Artem Bilan
@since 1.0
spring-xd-messagebus-spi/src/test/java/org/springframework/xd/dirt/integration/bus/MessageConverterTests.java