### Question:
IndexingManager { public Indexer getIndexerForMediaType(String mimeType) { if (mimeType != null) { for (Map.Entry<String, Indexer> entry : registryConfig.getIndexerMap().entrySet()) { if (Pattern.matches(entry.getKey(), mimeType)) { return entry.getValue(); } } } return null; } 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 testGetIndexerForMediaType() 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(); Indexer indexer = manager.getIndexerForMediaType("application/xml"); assertTrue(indexer instanceof XMLIndexer); assertNull(manager.getIndexerForMediaType("application/test")); }