JmxAddresses { public static JMXServiceURL getJmxServiceUrl(String host, int port) throws MalformedURLException { return getJmxServiceUrl(host, port, false); } private  JmxAddresses(); static boolean isNumericIPv6Address(String address); static JMXServiceURL getJmxServiceUrl(String host, int port); static JMXServiceURL getJmxServiceUrl(String host, int port, boolean jmxmp);  }
@Test public void getJmxServiceUrlIPv6NumericTest() throws Exception { int port = 8888; assertEquals(jmxUrlPath("[::1]", port), getJmxServiceUrl("::1", port).getURLPath()); assertEquals(jmxUrlPath("[::1]", port), getJmxServiceUrl("[::1]", port).getURLPath()); assertEquals(jmxUrlPath("127.0.0.1", port), getJmxServiceUrl("127.0.0.1", port).getURLPath()); assertEquals(jmxUrlPath("[2a06:6b8:b010:d007::1:c8]", port), getJmxServiceUrl("2a06:6b8:b010:d007::1:c8", port).getURLPath()); assertEquals(jmxUrlPath("localhost", port), getJmxServiceUrl("localhost", port).getURLPath()); assertEquals(jmxUrlPath("example.com", port), getJmxServiceUrl("example.com", port).getURLPath()); }