### Question:
IndexingManager { public void deleteFromIndex(String oldPath, int tenantId) throws RegistryException { getIndexer().getClient().deleteFromIndex(oldPath, tenantId); } private  IndexingManager(); static IndexingManager getInstance(); synchronized void startIndexing(); synchronized void restartIndexing(); synchronized void stopIndexing(); long getStartingDelayInSecs(); boolean canIndex(String path); long getIndexingFreqInSecs(); String getLastAccessTimeLocation(); long getBatchSize(); int getIndexerPoolSize(); boolean isCacheSkipped(); void deleteFromIndex(String oldPath, int tenantId); void submitFileForIndexing(int tenantID, String tenantDomain, String path,
            String sourceURL); Indexer getIndexerForMediaType(String mimeType); UserRegistry getRegistry(int tenantId); Date getLastAccessTime(int tenantId); void setLastAccessTime(int tenantId, Date lastAccessTime);  }### Answer:
@Test public void testDeleteFromIndex() throws RegistryException { UserRegistry userRegistry = mock(UserRegistry.class); RegistryService registryService = mock(RegistryService.class); when(registryService.getRegistry(CarbonConstants.REGISTRY_SYSTEM_USERNAME)).thenReturn(userRegistry); Utils.setRegistryService(registryService); IndexingManager manager = IndexingManager.getInstance(); manager.deleteFromIndex("/_system/local/index", 2); }