### Question:
ZooKeeperServerBean implements ZooKeeperServerMXBean, ZKMBeanInfo { @Override public String getSecureClientAddress() { if (zks.secureServerCnxnFactory != null) { return String.format("%s:%d", zks.secureServerCnxnFactory.getLocalAddress().getHostString(), zks.secureServerCnxnFactory.getLocalPort()); } return ""; } ZooKeeperServerBean(ZooKeeperServer zks); String getClientPort(); String getName(); boolean isHidden(); String getStartTime(); String getVersion(); double getAvgRequestLatency(); long getMaxRequestLatency(); long getMinRequestLatency(); long getOutstandingRequests(); int getTickTime(); void setTickTime(int tickTime); int getMaxClientCnxnsPerHost(); void setMaxClientCnxnsPerHost(int max); int getMinSessionTimeout(); void setMinSessionTimeout(int min); int getMaxSessionTimeout(); void setMaxSessionTimeout(int max); long getDataDirSize(); long getLogDirSize(); long getPacketsReceived(); long getPacketsSent(); long getFsyncThresholdExceedCount(); void resetLatency(); void resetMaxLatency(); void resetFsyncThresholdExceedCount(); void resetStatistics(); long getNumAliveConnections(); @Override String getSecureClientPort(); @Override String getSecureClientAddress(); @Override long getTxnLogElapsedSyncTime(); @Override int getJuteMaxBufferSize(); @Override int getLastClientResponseSize(); @Override int getMinClientResponseSize(); @Override int getMaxClientResponseSize(); @Override boolean getResponseCachingEnabled(); @Override void setResponseCachingEnabled(boolean isEnabled); int getConnectionMaxTokens(); void setConnectionMaxTokens(int val); int getConnectionTokenFillTime(); void setConnectionTokenFillTime(int val); int getConnectionTokenFillCount(); void setConnectionTokenFillCount(int val); int getConnectionFreezeTime(); void setConnectionFreezeTime(int val); double getConnectionDropIncrease(); void setConnectionDropIncrease(double val); double getConnectionDropDecrease(); void setConnectionDropDecrease(double val); double getConnectionDecreaseRatio(); void setConnectionDecreaseRatio(double val); int getCommitProcMaxReadBatchSize(); void setCommitProcMaxReadBatchSize(int size); int getCommitProcMaxCommitBatchSize(); void setCommitProcMaxCommitBatchSize(int size); @Override long getFlushDelay(); @Override void setFlushDelay(long delay); int getThrottledOpWaitTime(); void setThrottledOpWaitTime(int val); int getRequestThrottleLimit(); void setRequestThrottleLimit(int requests); int getRequestThrottleStallTime(); void setRequestThrottleStallTime(int time); boolean getRequestThrottleDropStale(); void setRequestThrottleDropStale(boolean drop); @Override long getMaxWriteQueuePollTime(); @Override void setMaxWriteQueuePollTime(long delay); boolean getRequestStaleLatencyCheck(); void setRequestStaleLatencyCheck(boolean check); @Override int getMaxBatchSize(); @Override void setMaxBatchSize(int size); boolean getRequestStaleConnectionCheck(); void setRequestStaleConnectionCheck(boolean check); int getLargeRequestMaxBytes(); void setLargeRequestMaxBytes(int bytes); int getLargeRequestThreshold(); void setLargeRequestThreshold(int threshold); int getMaxCnxns();  }### Answer:
@Test public void testGetSecureClientAddress() throws IOException { ZooKeeperServer zks = new ZooKeeperServer(); ZooKeeperServerBean serverBean = new ZooKeeperServerBean(zks); String result = serverBean.getSecureClientPort(); assertEquals("", result); ServerCnxnFactory cnxnFactory = ServerCnxnFactory.createFactory(); int secureClientPort = 8443; InetSocketAddress address = new InetSocketAddress(secureClientPort); cnxnFactory.configure(address, 5, -1, true); zks.setSecureServerCnxnFactory(cnxnFactory); result = serverBean.getSecureClientAddress(); String ipv4 = "0.0.0.0:" + secureClientPort; String ipv6 = "0:0:0:0:0:0:0:0:" + secureClientPort; assertTrue(result.equals(ipv4) || result.equals(ipv6)); cnxnFactory.shutdown(); }