@SuppressWarnings("rawtypes")
    @Converter(fallback = true)
    public static <T> T convertTo(Class<T> type, Exchange exchange, Object value, TypeConverterRegistry registry) {
        if (value instanceof JavaResult.ResultMap) {
            for (Object mapValue : ((Map) value).values()) {
                if (type.isInstance(mapValue)) {
                    return type.cast(mapValue);
                }
            }
        }

        return null;
    }
@Test
    public void convertStringResultToStreamSource() throws Exception {
        StringResult stringResult = createStringResult("Bajja");

        StreamSource streamSource = typeConverter.convertTo(StreamSource.class, stringResult);

        BufferedReader reader = new BufferedReader(streamSource.getReader());
        assertEquals("Bajja", reader.readLine());
    }