@Converter(fallback = true)
    public static <T> T convertTo(Class<T> type, Exchange exchange, Object value, TypeConverterRegistry registry)
            throws MessagingException, IOException {
        if (Multipart.class.isAssignableFrom(value.getClass())) {
            TypeConverter tc = registry.lookup(type, String.class);
            if (tc != null) {
                String s = toString((Multipart) value);
                if (s != null) {
                    return tc.convertTo(type, s);
                }
            }
        }
        return null;
    }
@Test
    public void testMultipartToByteArray() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(1);

        template.send("direct:a", new Processor() {
            public void process(Exchange exchange) {
                exchange.getIn().setBody("Hello World");
                exchange.getIn().setHeader(MailConstants.MAIL_ALTERNATIVE_BODY, "Alternative World");
            }
        });

        MockEndpoint.assertIsSatisfied(context);

        Message mailMessage = mock.getReceivedExchanges().get(0).getIn().getBody(MailMessage.class).getMessage();
        assertNotNull(mailMessage);

        Object content = mailMessage.getContent();
        assertIsInstanceOf(Multipart.class, content);

        byte[] is = mock.getReceivedExchanges().get(0).getIn().getBody(byte[].class);
        assertNotNull(is);
        assertEquals("Alternative World", context.getTypeConverter().convertTo(String.class, is));
    }