@Override
    public String serviceToUrl(String protocol, String serviceId, String tag, String requestKey) {
        if(StringUtils.isBlank(serviceId)) {
            logger.debug("The serviceId cannot be blank");
            return null;
        }
        URL url = loadBalance.select(discovery(protocol, serviceId, tag), serviceId, tag, requestKey);
        if (url != null) {
            logger.debug("Final url after load balance = {}.", url);
            // construct a url in string
            return protocol + "://" + url.getHost() + ":" + url.getPort();
        } else {
            logger.debug("The service: {} cannot be found from service discovery.", serviceId);
            return null;
        }
    }
@Test
    public void testServiceToUrlWithEnvironment() {
        String s = cluster.serviceToUrl("https", "com.networknt.portal.command-1.0.0", "0000", null);
        System.out.println(s);
        Assert.assertTrue("https://localhost:8440".equals(s));
        s = cluster.serviceToUrl("https", "com.networknt.portal.command-1.0.0", "0001", null);
        System.out.println(s);
        Assert.assertTrue("https://localhost:8441".equals(s));
        s = cluster.serviceToUrl("https", "com.networknt.portal.command-1.0.0", "0002", null);
        System.out.println(s);
        Assert.assertTrue("https://localhost:8442".equals(s));

    }