### Question:
SouthboundProvider implements ClusteredDataTreeChangeListener<Topology>, AutoCloseable { @PostConstruct public void init() { LOG.info("SouthboundProvider Session Initiated"); ovsdbStatusProvider.reportStatus(ServiceState.STARTING, "OVSDB initialization in progress"); this.txInvoker = new TransactionInvokerImpl(db); cm = new OvsdbConnectionManager(db, txInvoker, entityOwnershipService, ovsdbConnection, instanceIdentifierCodec, upgradeState); ovsdbDataTreeChangeListener = new OvsdbDataTreeChangeListener(db, cm, instanceIdentifierCodec); ovsdbOperGlobalListener = new OvsdbOperGlobalListener(db, cm, txInvoker); providerOwnershipChangeListener = new SouthboundPluginInstanceEntityOwnershipListener(this,this.entityOwnershipService); Entity instanceEntity = new Entity(ENTITY_TYPE, ENTITY_TYPE); try { registration = entityOwnershipService.registerCandidate(instanceEntity); } catch (CandidateAlreadyRegisteredException e) { LOG.warn("OVSDB Southbound Provider instance entity {} was already " + "registered for ownership", instanceEntity, e); } InstanceIdentifier<Topology> path = InstanceIdentifier .create(NetworkTopology.class) .child(Topology.class, new TopologyKey(SouthboundConstants.OVSDB_TOPOLOGY_ID)); DataTreeIdentifier<Topology> treeId = DataTreeIdentifier.create(LogicalDatastoreType.OPERATIONAL, path); LOG.trace("Registering listener for path {}", treeId); operTopologyRegistration = db.registerDataTreeChangeListener(treeId, this); ovsdbUpgradeStateListener = new OvsdbUpgradeStateListener(db, cm); } @Inject  SouthboundProvider(@Reference final DataBroker dataBroker,
                              @Reference final EntityOwnershipService entityOwnershipServiceDependency,
                              @Reference final OvsdbConnection ovsdbConnection,
                              @Reference final DOMSchemaService schemaService,
                              @Reference final BindingNormalizedNodeSerializer bindingNormalizedNodeSerializer,
                              @Reference final SystemReadyMonitor systemReadyMonitor,
                              @Reference final DiagStatusService diagStatusService,
                              @Reference final UpgradeState upgradeState); static DataBroker getDb(); @PostConstruct void init(); @Override @PreDestroy void close(); void handleOwnershipChange(final EntityOwnershipChange ownershipChange); @Override void onDataTreeChanged(final Collection<DataTreeModification<Topology>> collection); void setSkipMonitoringManagerStatus(final boolean flag); static void setBridgesReconciliationInclusionList(final List<String> bridgeList); static void setBridgesReconciliationExclusionList(final List<String> bridgeList); static List<String> getBridgesReconciliationInclusionList(); static List<String> getBridgesReconciliationExclusionList(); UpgradeState getUpgradeState();  }### Answer:
@Test public void testInit() throws CandidateAlreadyRegisteredException { when(entityOwnershipService.getOwnershipState(any(Entity.class))).thenReturn( java.util.Optional.of(EntityOwnershipState.from(true, true))); try (SouthboundProvider southboundProvider = new SouthboundProvider( getDataBroker(), entityOwnershipService, Mockito.mock(OvsdbConnection.class), Mockito.mock(DOMSchemaService.class), Mockito.mock(BindingNormalizedNodeSerializer.class), new TestSystemReadyMonitor(IMMEDIATE), Mockito.mock(DiagStatusService.class), Mockito.mock(UpgradeState.class))) { southboundProvider.init(); verify(entityOwnershipService, atLeastOnce()).registerListener( anyString(), any(EntityOwnershipListener.class)); verify(entityOwnershipService).registerCandidate(any(Entity.class)); } }