### Question:
AsyncIndexer implements Runnable { public void run() { indexFile(); } protected  AsyncIndexer(); void addFile(File2Index file2Index); SolrClient getClient(); void run();  }### Answer:
@Test public void run() throws Exception { AsyncIndexer indexer = new AsyncIndexer(); byte[] data = RegistryUtils.encodeString("testing"); String mediaType = "application/json"; String path = "/_system/local/index"; int tenant = -12345; String tenantDomain = "fb.com"; AsyncIndexer.File2Index file2Index = new AsyncIndexer.File2Index(data, mediaType, path, tenant, tenantDomain); indexer.addFile(file2Index); indexer.run(); }
@Test public void createIndexDocument() throws Exception { byte[] data = RegistryUtils.encodeString("testing"); String mediaType = "application/json"; String path = "/_system/local/index"; int tenant = -1234; String tenantDomain = "fb.com"; AsyncIndexer.File2Index file2Index = new AsyncIndexer.File2Index(data, mediaType, path, tenant, tenantDomain); AsyncIndexer.IndexingTask indexingTask = new AsyncIndexer.IndexingTask(file2Index); indexingTask.run(); }