public static String normalizeUri(String uri) throws URISyntaxException {
        // try to parse using the simpler and faster Camel URI parser
        String[] parts = CamelURIParser.fastParseUri(uri);
        if (parts != null) {
            // we optimized specially if an empty array is returned
            if (parts == URI_ALREADY_NORMALIZED) {
                return uri;
            }
            // use the faster and more simple normalizer
            return doFastNormalizeUri(parts);
        } else {
            // use the legacy normalizer as the uri is complex and may have unsafe URL characters
            return doComplexNormalizeUri(uri);
        }
    }
@Test
    public void testNormalizeEndpointUriNoParam() throws Exception {
        String out1 = URISupport.normalizeUri("direct:foo");
        String out2 = URISupport.normalizeUri("direct:foo");
        assertEquals(out1, out2);

        out1 = URISupport.normalizeUri("direct://foo");
        out2 = URISupport.normalizeUri("direct://foo");
        assertEquals(out1, out2);

        out1 = URISupport.normalizeUri("direct:foo");
        out2 = URISupport.normalizeUri("direct://foo");
        assertEquals(out1, out2);

        out1 = URISupport.normalizeUri("direct://foo");
        out2 = URISupport.normalizeUri("direct:foo");
        assertEquals(out1, out2);

        out1 = URISupport.normalizeUri("direct://foo");
        out2 = URISupport.normalizeUri("direct:bar");
        assertNotSame(out1, out2);
    }