### Question:
IndexingManager { public boolean canIndex(String path) { if (patterns == null) { patterns = registryConfig.getExclusionPatterns(); } for (Pattern pattern : patterns) { if (pattern.matcher(path).matches()) { return false; } } return true; } 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 testCanIndex() 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(); assertTrue(manager.canIndex("/_system/local/index")); assertFalse(manager.canIndex("/_system/local/repository/components/org.wso2.carbon" + ".registry/mount/_system_governance")); }