### Question:
OvsdbConnectionManager implements OvsdbConnectionListener, AutoCloseable { public OvsdbClient getClient(final ConnectionInfo connectionInfo) { OvsdbConnectionInstance connectionInstance = getConnectionInstance(connectionInfo); if (connectionInstance != null) { return connectionInstance.getOvsdbClient(); } return null; } OvsdbConnectionManager(final DataBroker db,final TransactionInvoker txInvoker,
                                  final EntityOwnershipService entityOwnershipService,
                                  final OvsdbConnection ovsdbConnection,
                                  final InstanceIdentifierCodec instanceIdentifierCodec,
                                  final UpgradeState upgradeState); @Override void connected(final OvsdbClient externalClient); OvsdbConnectionInstance connectedButCallBacksNotRegistered(final OvsdbClient externalClient); @Override void disconnected(final OvsdbClient client); OvsdbClient connect(final InstanceIdentifier<Node> iid,
            final OvsdbNodeAugmentation ovsdbNode); void disconnect(final OvsdbNodeAugmentation ovsdbNode); @Override void close(); InstanceIdentifier<Node> getInstanceIdentifier(final ConnectionInfo key); OvsdbConnectionInstance getConnectionInstance(final ConnectionInfo key); OvsdbConnectionInstance getConnectionInstance(final OvsdbBridgeAttributes mn); OvsdbConnectionInstance getConnectionInstance(final Node node); OvsdbConnectionInstance getConnectionInstance(final InstanceIdentifier<Node> nodePath); OvsdbClient getClient(final ConnectionInfo connectionInfo); OvsdbClient getClient(final OvsdbBridgeAttributes mn); OvsdbClient getClient(final Node node); Boolean getHasDeviceOwnership(final ConnectionInfo connectionInfo); void reconcileConnection(final InstanceIdentifier<Node> iid, final OvsdbNodeAugmentation ovsdbNode); void stopConnectionReconciliationIfActive(final InstanceIdentifier<Node> iid,
            final OvsdbNodeAugmentation ovsdbNode); void stopBridgeConfigReconciliationIfActive(final InstanceIdentifier<Node> iid); void reconcileBridgeConfigurations(final OvsdbConnectionInstance client); Map<ConnectionInfo, OvsdbConnectionInstance> getClients();  }### Answer:
@Test public void testGetClient() { OvsdbConnectionInstance ovsdbClient = mock(OvsdbConnectionInstance.class); OvsdbClient client = mock(OvsdbClient.class); when(ovsdbClient.getOvsdbClient()).thenReturn(client); ConnectionInfo key = mock(ConnectionInfo.class); suppress(MemberMatcher.method(OvsdbConnectionManager.class, "getConnectionInstance", ConnectionInfo.class)); when(ovsdbConnManager.getConnectionInstance(key)).thenReturn(ovsdbClient); assertEquals("Error getting correct OvsdbClient object", ovsdbClient.getOvsdbClient(), ovsdbConnManager.getClient(key)); OvsdbBridgeAttributes mn = mock(OvsdbBridgeAttributes.class); suppress(MemberMatcher.method(OvsdbConnectionManager.class, "getConnectionInstance", OvsdbBridgeAttributes.class)); when(ovsdbConnManager.getConnectionInstance(mn)).thenReturn(ovsdbClient); assertEquals("Error getting correct OvsdbClient object", ovsdbClient.getOvsdbClient(), ovsdbConnManager.getClient(mn)); Node node = mock(Node.class); suppress(MemberMatcher.method(OvsdbConnectionManager.class, "getConnectionInstance", Node.class)); when(ovsdbConnManager.getConnectionInstance(node)).thenReturn(ovsdbClient); assertEquals("Error getting correct OvsdbClient object", ovsdbClient.getOvsdbClient(), ovsdbConnManager.getClient(node)); }