JcrNamespaceRegistry implements org.modeshape.jcr.api.NamespaceRegistry { @Override 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; } protected  JcrNamespaceRegistry( NamespaceRegistry workspaceRegistry,
                                    JcrSession session );   JcrNamespaceRegistry( Behavior behavior,
                          NamespaceRegistry localRegistry,
                          NamespaceRegistry workspaceRegistry,
                          JcrSession session ); @Override String getPrefix( String uri ); @Override String[] getPrefixes(); @Override String getURI( String prefix ); @Override String[] getURIs(); @Override boolean isRegisteredPrefix( String prefix ); @Override boolean isRegisteredUri( String uri ); @Override synchronized void registerNamespace( String prefix,
                                                String uri ); @Override synchronized void unregisterNamespace( String prefix ); @Override String registerNamespace( String uri ); @Override String toString();  }
@Test( expected = NamespaceException.class ) public void shouldNotAllowUnregisteredPrefix() throws Exception { registry.getURI("bogus"); }