### Question:
HadoopCatalog extends BaseMetastoreCatalog implements Closeable, SupportsNamespaces { @Override public Map<String, String> loadNamespaceMetadata(Namespace namespace) { Path nsPath = new Path(warehouseLocation, SLASH.join(namespace.levels())); if (!isNamespace(nsPath) || namespace.isEmpty()) { throw new NoSuchNamespaceException("Namespace does not exist: %s", namespace); } return ImmutableMap.of("location", nsPath.toString()); } HadoopCatalog(String name, Configuration conf, String warehouseLocation);  HadoopCatalog(Configuration conf, String warehouseLocation);  HadoopCatalog(Configuration conf); @Override String name(); @Override List<TableIdentifier> listTables(Namespace namespace); @Override boolean dropTable(TableIdentifier identifier, boolean purge); @Override void renameTable(TableIdentifier from, TableIdentifier to); @Override void createNamespace(Namespace namespace, Map<String, String> meta); @Override List<Namespace> listNamespaces(Namespace namespace); @Override boolean dropNamespace(Namespace namespace); @Override boolean setProperties(Namespace namespace,  Map<String, String> properties); @Override boolean removeProperties(Namespace namespace,  Set<String> properties); @Override Map<String, String> loadNamespaceMetadata(Namespace namespace); @Override void close(); @Override String toString(); @Override TableBuilder buildTable(TableIdentifier identifier, Schema schema);  }### Answer:
@Test public void testLoadNamespaceMeta() throws IOException { Configuration conf = new Configuration(); String warehousePath = temp.newFolder().getAbsolutePath(); HadoopCatalog catalog = new HadoopCatalog(conf, warehousePath); TableIdentifier tbl1 = TableIdentifier.of("db", "ns1", "ns2", "metadata"); TableIdentifier tbl2 = TableIdentifier.of("db", "ns2", "ns3", "tbl2"); TableIdentifier tbl3 = TableIdentifier.of("db", "ns3", "tbl4"); TableIdentifier tbl4 = TableIdentifier.of("db", "metadata"); Lists.newArrayList(tbl1, tbl2, tbl3, tbl4).forEach(t -> catalog.createTable(t, SCHEMA, PartitionSpec.unpartitioned()) ); catalog.loadNamespaceMetadata(Namespace.of("db")); AssertHelpers.assertThrows("Should fail to load namespace doesn't exist", NoSuchNamespaceException.class, "Namespace does not exist: ", () -> { catalog.loadNamespaceMetadata(Namespace.of("db", "db2", "ns2")); }); }