### Question:
JcrNamespaceRegistry implements javax.jcr.NamespaceRegistry { public String getURI( String prefix ) throws NamespaceException, RepositoryException { checkSession(); if (behavior == Behavior.WORKSPACE) { String uri = STANDARD_BUILT_IN_NAMESPACES_BY_PREFIX.get(prefix); if (uri != null) return uri; } String uri = registry.getNamespaceForPrefix(prefix); if (uri == null) { throw new NamespaceException(JcrI18n.noNamespaceWithPrefix.text(prefix)); } return uri; } JcrNamespaceRegistry( NamespaceRegistry workspaceRegistry,
                          JcrSession session );   JcrNamespaceRegistry( Behavior behavior,
                          NamespaceRegistry localRegistry,
                          NamespaceRegistry workspaceRegistry,
                          JcrSession session ); String getPrefix( String uri ); String[] getPrefixes(); String getURI( String prefix ); String[] getURIs(); synchronized void registerNamespace( String prefix,
                                                String uri ); synchronized void unregisterNamespace( String prefix ); @Override String toString();  }### Answer:
@Test( expected = NamespaceException.class ) public void shouldNotAllowUnregisteredPrefix() throws Exception { registry.getURI("bogus"); }