### Question:
FSTableDescriptors implements TableDescriptors { @Override public HTableDescriptor get(final byte [] tablename) throws IOException { return get(Bytes.toString(tablename)); } FSTableDescriptors(final FileSystem fs, final Path rootdir);  FSTableDescriptors(final FileSystem fs, final Path rootdir,
      final boolean fsreadOnly); @Override HTableDescriptor get(final byte [] tablename); @Override HTableDescriptor get(final String tablename); @Override Map<String, HTableDescriptor> getAll(); @Override void add(HTableDescriptor htd); @Override HTableDescriptor remove(final String tablename); static boolean isTableInfoExists(FileSystem fs, Path rootdir,
      String tableName); static FileStatus getTableInfoPath(final FileSystem fs,
      final Path tabledir); static HTableDescriptor getTableDescriptor(FileSystem fs,
      Path hbaseRootDir, byte[] tableName); static HTableDescriptor getTableDescriptor(FileSystem fs, Path tableDir); static void deleteTableDescriptorIfExists(String tableName,
      Configuration conf); static boolean createTableDescriptor(final HTableDescriptor htableDescriptor,
      Configuration conf); static boolean createTableDescriptor(FileSystem fs, Path rootdir,
      HTableDescriptor htableDescriptor); static boolean createTableDescriptor(FileSystem fs, Path rootdir,
      HTableDescriptor htableDescriptor, boolean forceCreation); static boolean createTableDescriptorForTableDirectory(FileSystem fs, Path tabledir,
      HTableDescriptor htableDescriptor, boolean forceCreation); static final String TABLEINFO_NAME; }### Answer:
@Test public void testNoSuchTable() throws IOException { final String name = "testNoSuchTable"; FileSystem fs = FileSystem.get(UTIL.getConfiguration()); Path rootdir = new Path(UTIL.getDataTestDir(), name); TableDescriptors htds = new FSTableDescriptors(fs, rootdir); assertNull("There shouldn't be any HTD for this table", htds.get("NoSuchTable")); }
@Test public void testReadingArchiveDirectoryFromFS() throws IOException { FileSystem fs = FileSystem.get(UTIL.getConfiguration()); try { new FSTableDescriptors(fs, FSUtils.getRootDir(UTIL.getConfiguration())) .get(HConstants.HFILE_ARCHIVE_DIRECTORY); fail("Shouldn't be able to read a table descriptor for the archive directory."); } catch (IOException e) { LOG.debug("Correctly got error when reading a table descriptor from the archive directory: " + e.getMessage()); } }