### Question:
SxpEpProviderProviderInstance implements SxpEpProviderProvider, ClusterSingletonService, AutoCloseable { @Override public ListenableFuture<Void> closeServiceInstance() { LOG.info("Instance {} closed", this.getClass().getSimpleName()); try { sxpEpProviderProvider.close(); } catch (Exception e) { LOG.warn("Exception while closing ... {}", e.getMessage()); } return Futures.immediateFuture(null); } SxpEpProviderProviderInstance(DataBroker dataBroker, BaseEndpointService endpointService,
                                         DomainSpecificRegistry registry,
                                         ClusterSingletonServiceProvider clusterSingletonService,
                                         SgtGeneratorConfig sgtGeneratorConfig); void initialize(); @Override void instantiateServiceInstance(); @Override ListenableFuture<Void> closeServiceInstance(); @Override void close(); @Override ServiceGroupIdentifier getIdentifier(); @Override EPToSgtMapper getEPToSgtMapper(); @Override EPPolicyTemplateProviderRegistry getEPPolicyTemplateProviderRegistry();  }### Answer:
@Test public void testCloseServiceInstance() throws Exception { instance.instantiateServiceInstance(); final ListenableFuture<Void> future = instance.closeServiceInstance(); Mockito.verify(sxpEpProviderProvider).close(); Assert.assertTrue(future.isDone()); Assert.assertNull(future.get()); }
@Test public void testCloseServiceInstance_null() throws Exception { final ListenableFuture<Void> future = instance.closeServiceInstance(); Assert.assertTrue(future.isDone()); Assert.assertNull(future.get()); }