public <T> Map<String, T> lookupByType(Class<T> type) {
        return registry.findByTypeWithName(type);
    }
@Test
    public void testRouteWithSpringProcessor() throws Exception {
        doTestMain("classpath:org/apache/camel/main/xml/spring-camel1.xml", (main, camelContext) -> {
            try {
                MockEndpoint endpoint = camelContext.getEndpoint("mock:finish", MockEndpoint.class);
                endpoint.expectedBodiesReceived("Hello World (2147483647)");

                main.getCamelTemplate().sendBody("direct:start", "I'm World");

                endpoint.assertIsSatisfied();

                assertTrue(camelContext.getUuidGenerator() instanceof ShortUuidGenerator);

                Bean1 bean1 = main.lookupByType(Bean1.class).get("bean1");
                Bean2 bean2 = bean1.getBean();
                assertSame(bean1, bean2.getBean());
            } catch (Exception e) {
                fail(e.getMessage());
            }
        });
    }