Client implements ConnectedComponent { public void close() { if (_protocol != null) { _protocol.unregisterComponent(this); _protocol.disconnect(); _protocol = null; _proxyManager.shutdown(); } } Client(Class<? extends VersionedProtocol> serverClass);  Client(Class<? extends VersionedProtocol> serverClass, final ZkConfiguration config);  Client(Class<? extends VersionedProtocol> serverClass, InteractionProtocol protocol);  Client(Class<? extends VersionedProtocol> serverClass, final INodeSelectionPolicy nodeSelectionPolicy);  Client(Class<? extends VersionedProtocol> serverClass, final INodeSelectionPolicy policy,
          final ZkConfiguration zkConfig);  Client(Class<? extends VersionedProtocol> serverClass, final INodeSelectionPolicy policy,
          final ZkConfiguration zkConfig, ClientConfiguration clientConfiguration);  Client(Class<? extends VersionedProtocol> serverClass, final INodeSelectionPolicy policy,
          final InteractionProtocol protocol, ClientConfiguration clientConfiguration); INodeSelectionPolicy getSelectionPolicy(); INodeProxyManager getProxyManager(); void setProxyCreator(INodeProxyManager proxyManager); ClientResult<T> broadcastToAll(long timeout, boolean shutdown, Method method, int shardArrayParamIndex,
          Object... args); ClientResult<T> broadcastToAll(IResultPolicy<T> resultPolicy, Method method, int shardArrayParamIndex,
          Object... args); ClientResult<T> broadcastToIndices(long timeout, boolean shutdown, Method method, int shardArrayIndex,
          String[] indices, Object... args); ClientResult<T> broadcastToIndices(IResultPolicy<T> resultPolicy, Method method, int shardArrayIndex,
          String[] indices, Object... args); ClientResult<T> singlecast(long timeout, boolean shutdown, Method method, int shardArrayParamIndex,
          String shard, Object... args); ClientResult<T> singlecast(IResultPolicy<T> resultPolicy, Method method, int shardArrayParamIndex,
          String shard, Object... args); ClientResult<T> broadcastToShards(long timeout, boolean shutdown, Method method, int shardArrayParamIndex,
          List<String> shards, Object... args); ClientResult<T> broadcastToShards(IResultPolicy<T> resultPolicy, Method method, int shardArrayParamIndex,
          List<String> shards, Object... args); double getQueryPerMinute(); void close(); @Override void disconnect(); @Override void reconnect(); List<String> getIndices();  }
@Test public void testClose() throws Exception { InteractionProtocol protocol = mock(InteractionProtocol.class); Client client = new Client(ISleepServer.class, new BasicNodeSelectionPolicy(), protocol, new ClientConfiguration()); client.close(); verify(protocol).unregisterComponent(client); verify(protocol).disconnect(); }