### Question:
FSDirectory implements Closeable { public INode getInode(long id) { return inodeMap.get(id); } FSDirectory(FSNamesystem ns, Configuration conf); void setINodeAttributeProvider(
      @Nullable INodeAttributeProvider provider); @Deprecated // dirLock is obsolete, use namesystem.fsLock instead int getReadHoldCount(); @Deprecated // dirLock is obsolete, use namesystem.fsLock instead int getWriteHoldCount(); int getListLimit(); boolean isImageLoaded(); SortedSet<String> getProtectedDirectories(); boolean isProtectedSubDirectoriesEnable(); INodeDirectory getRoot(); BlockStoragePolicySuite getBlockStoragePolicySuite(); @VisibleForTesting boolean isPosixAclInheritanceEnabled(); @VisibleForTesting void setPosixAclInheritanceEnabled(
      boolean posixAclInheritanceEnabled); @Override void close(); @VisibleForTesting INodesInPath resolvePath(FSPermissionChecker pc, String src,
      DirOp dirOp); INodesInPath unprotectedResolvePath(String src); boolean isNonEmptyDirectory(INodesInPath inodesInPath); void updateCount(INodesInPath iip, INode.QuotaDelta quotaDelta,
      boolean check); void updateSpaceForCompleteBlock(BlockInfo completeBlk,
      INodesInPath inodes); EnumCounters<StorageType> getStorageTypeDeltas(byte storagePolicyID,
      long dsDelta, short oldRep, short newRep); @VisibleForTesting INodesInPath addLastINode(INodesInPath existing, INode inode,
      FsPermission modes, boolean checkQuota); @VisibleForTesting long removeLastINode(final INodesInPath iip); @VisibleForTesting long getYieldCount(); INodeMap getINodeMap(); final void addToInodeMap(INode inode); final void addRootDirToEncryptionZone(XAttrFeature xaf); final void removeFromInodeMap(List<? extends INode> inodes); INode getInode(long id); static byte[][] getPathComponents(INode inode); static boolean isReservedName(INode inode); static boolean isReservedName(String src); static boolean isExactReservedName(String src); static boolean isExactReservedName(byte[][] components); INodesInPath getINodesInPath(String src, DirOp dirOp); INodesInPath getINodesInPath(byte[][] components, DirOp dirOp); @VisibleForTesting // should be removed after a lot of tests are updated INode getINode(String src); @VisibleForTesting // should be removed after a lot of tests are updated INode getINode4Write(String src); INode getINode(String src, DirOp dirOp); long getLastInodeId(); final static String DOT_RESERVED_STRING; final static String DOT_RESERVED_PATH_PREFIX; final static byte[] DOT_RESERVED; final static String DOT_INODES_STRING; final static byte[] DOT_INODES; final static HdfsFileStatus DOT_RESERVED_STATUS; final static HdfsFileStatus DOT_SNAPSHOT_DIR_STATUS; @VisibleForTesting
  final EncryptionZoneManager ezManager; }### Answer:
@Test public void testDumpTree() throws Exception { final INode root = fsdir.getINode("/"); LOG.info("Original tree"); final StringBuffer b1 = root.dumpTreeRecursively(); System.out.println("b1=" + b1); final BufferedReader in = new BufferedReader(new StringReader(b1.toString())); String line = in.readLine(); checkClassName(line); for(; (line = in.readLine()) != null; ) { line = line.trim(); if (!line.isEmpty() && !line.contains("snapshot")) { assertTrue("line=" + line, line.startsWith(INodeDirectory.DUMPTREE_LAST_ITEM) || line.startsWith(INodeDirectory.DUMPTREE_EXCEPT_LAST_ITEM) ); checkClassName(line); } } }