### Question:
DefaultNamespacePathLocator implements NamespacePathLocator { @Override public Location get(NamespaceId namespaceId) throws IOException { if (isReservedNamespace(namespaceId)) { return getNonCustomMappedLocation(namespaceId); } try { return get(namespaceQueryAdmin.get(namespaceId)); } catch (IOException e) { throw e; } catch (Exception e) { throw new IOException(String.format("Failed to get namespace meta for namespace %s", namespaceId), e); } } @Inject  DefaultNamespacePathLocator(CConfiguration cConf,
                                     LocationFactory locationFactory,
                                     NamespaceQueryAdmin namespaceQueryAdmin); @Override Location get(NamespaceId namespaceId); @Override Location get(NamespaceMeta namespaceMeta);  }### Answer:
@Test public void testGet() throws Exception { File locationFactoryPath = TEMP_FOLDER.newFolder(); LocationFactory locationFactory = new LocalLocationFactory(locationFactoryPath); NamespaceAdmin nsAdmin = new InMemoryNamespaceAdmin(); NamespaceId ns1 = new NamespaceId("ns1"); NamespaceMeta defaultNSMeta = new NamespaceMeta.Builder().setName(NamespaceId.DEFAULT).build(); NamespaceMeta ns1NSMeta = new NamespaceMeta.Builder().setName(ns1).setRootDirectory("/ns1").build(); nsAdmin.create(defaultNSMeta); nsAdmin.create(ns1NSMeta); CConfiguration cConf = CConfiguration.create(); NamespacePathLocator namespacePathLocator = new DefaultNamespacePathLocator(cConf, locationFactory, nsAdmin); Location defaultLoc = namespacePathLocator.get(NamespaceId.DEFAULT); Location ns1Loc = namespacePathLocator.get(ns1); Location expectedLocation = locationFactory.create(cConf.get(Constants.Namespace.NAMESPACES_DIR)) .append(NamespaceId.DEFAULT.getNamespace()); Assert.assertEquals(expectedLocation, defaultLoc); expectedLocation = Locations.getLocationFromAbsolutePath(locationFactory, "/ns1"); Assert.assertEquals(expectedLocation, ns1Loc); Assert.assertNotEquals(defaultLoc, ns1Loc); Location sub1 = namespacePathLocator.get(ns1).append("sub1"); Location sub2 = namespacePathLocator.get(ns1).append("sub2"); Assert.assertNotEquals(sub1, sub2); }