HickwallMetric implements MetricProxy { @VisibleForTesting protected String getFormattedRedisAddr(HostPort hostPort) { return hostPort.getHost().replaceAll("\\.", "_") + "_" + hostPort.getPort(); } HickwallMetric(); @Override void writeBinMultiDataPoint(MetricData rawData); @Override int getOrder();  }
@Test public void testGetFormattedRedisAddr() { HostPort hostPort = new HostPort("10.2.2.2", 6379); String result = hickwallMetricProxy.getFormattedRedisAddr(hostPort); Assert.assertEquals("10_2_2_2_6379", result); }