### Question:
JcrNamespaceRegistry implements javax.jcr.NamespaceRegistry { public String getPrefix( String uri ) throws NamespaceException, RepositoryException { checkSession(); if (behavior == Behavior.WORKSPACE) { String prefix = STANDARD_BUILT_IN_PREFIXES_BY_NAMESPACE.get(uri); if (prefix != null) return prefix; } String prefix = registry.getPrefixForNamespaceUri(uri, false); if (prefix == null) { throw new NamespaceException(JcrI18n.noNamespaceWithUri.text(uri)); } return prefix; } 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 shouldNotAllowUnregisteredUri() throws Exception { registry.getPrefix("bogus"); }