### Question:
AbstractIndexerVisitor extends AbstractIrodsVisitorComponent { public abstract boolean visitWithMetadata(HierLeaf hierLeaf, MetadataRollup metadataRollup); AbstractIndexerVisitor(final IRODSAccessObjectFactory irodsAccessObjectFactory,
			final IRODSAccount irodsAccount); @Override boolean visitEnter(final HierComposite node); abstract boolean visitEnterWithMetadata(HierComposite node, MetadataRollup metadataRollup); @Override boolean visitLeave(final HierComposite node, final boolean wasEntered); abstract boolean visitLeaveWithMetadata(HierComposite node, MetadataRollup metadataRollup,
			boolean visitorEntered); @Override boolean visit(final HierLeaf node); void launch(final String startingCollectionPath); abstract boolean visitWithMetadata(HierLeaf hierLeaf, MetadataRollup metadataRollup); ConfigurableIndexerFilter getIndexerFilter(); void setIndexerFilter(final ConfigurableIndexerFilter indexerFilter); ControlRod getControlRod(); void setControlRod(final ControlRod controlRod); MetadataRollup getMetadataRollup(); void setMetadataRollup(final MetadataRollup metadataRollup); static final Logger log; }### Answer:
@Test public void testVisitWithMetadata() throws Exception { String testFileName = "testVisitWithMetadata.dat"; String absPath = scratchFileUtils.createAndReturnAbsoluteScratchPath(IRODS_TEST_SUBDIR_PATH); String localFileName = FileGenerator.generateFileOfFixedLengthGivenName(absPath, testFileName, 10); IRODSAccount irodsAccount = testingPropertiesHelper.buildIRODSAccountFromTestProperties(testingProperties); String targetIrodsCollection = testingPropertiesHelper .buildIRODSCollectionAbsolutePathFromTestProperties(testingProperties, IRODS_TEST_SUBDIR_PATH); String dataObjectAbsPath = targetIrodsCollection + '/' + testFileName; DataTransferOperations dto = irodsFileSystem.getIRODSAccessObjectFactory() .getDataTransferOperations(irodsAccount); DataObjectAO dataObjectAO = irodsFileSystem.getIRODSAccessObjectFactory().getDataObjectAO(irodsAccount); String expectedAttribName = "testmdattrib1"; String expectedAttribValue = "testmdvalue1"; String expectedAttribUnits = "test1mdunits"; dto.putOperation(localFileName, targetIrodsCollection, irodsAccount.getDefaultStorageResource(), null, null); AvuData avuData = AvuData.instance(expectedAttribName, expectedAttribValue, expectedAttribUnits); dataObjectAO.deleteAVUMetadata(dataObjectAbsPath, avuData); dataObjectAO.addAVUMetadata(dataObjectAbsPath, avuData); IRODSFileImpl irodsFile = (IRODSFileImpl) irodsFileSystem.getIRODSFileFactory(irodsAccount) .instanceIRODSFile(dataObjectAbsPath); IrodsVisitedLeaf leaf = new IrodsVisitedLeaf(irodsFile); TestIndexVisitor visitor = new TestIndexVisitor(irodsFileSystem.getIRODSAccessObjectFactory(), irodsAccount); leaf.accept(visitor); NodeVisitLog log = visitor.getNodeVisitLog(); Assert.assertFalse("no log entries", log.getLogEntries().isEmpty()); NodeVisitLogEntry actual = log.getLogEntries().get(0); Assert.assertEquals(VisitTypeEnum.VISIT_LEAF, actual.getVisitType()); Assert.assertEquals(dataObjectAbsPath, actual.getNodeAbsolutePath()); Assert.assertEquals(testFileName, actual.getNodeName()); Assert.assertEquals(1, actual.getMetadataThisLevel().size()); MetaDataAndDomainData md = actual.getMetadataThisLevel().get(0); Assert.assertEquals(expectedAttribName, md.getAvuAttribute()); }