### Question:
JcrSession implements Session { public String getNamespaceURI( String prefix ) throws RepositoryException { return sessionRegistry.getURI(prefix); } JcrSession( JcrRepository repository,
                JcrWorkspace workspace,
                ExecutionContext sessionContext,
                NamespaceRegistry globalNamespaceRegistry,
                Map<String, Object> sessionAttributes ); boolean isLive(); Workspace getWorkspace(); Repository getRepository(); Object getAttribute( String name ); String[] getAttributeNames(); String getNamespacePrefix( String uri ); String[] getNamespacePrefixes(); String getNamespaceURI( String prefix ); void setNamespacePrefix( String newPrefix,
                                    String existingUri ); void addLockToken( String lt ); void checkPermission( String path,
                                 String actions ); boolean hasPermission( String path,
                                  String actions ); boolean hasCapability( String methodName,
                                  Object target,
                                  Object[] arguments ); void exportDocumentView( String absPath,
                                    ContentHandler contentHandler,
                                    boolean skipBinary,
                                    boolean noRecurse ); void exportDocumentView( String absPath,
                                    OutputStream out,
                                    boolean skipBinary,
                                    boolean noRecurse ); void exportSystemView( String absPath,
                                  ContentHandler contentHandler,
                                  boolean skipBinary,
                                  boolean noRecurse ); void exportSystemView( String absPath,
                                  OutputStream out,
                                  boolean skipBinary,
                                  boolean noRecurse ); ContentHandler getImportContentHandler( String parentAbsPath,
                                                   int uuidBehavior ); Item getItem( String absolutePath ); AbstractJcrNode getNode( String absolutePath ); boolean nodeExists( String absolutePath ); AbstractJcrProperty getProperty( String absolutePath ); boolean propertyExists( String absolutePath ); void removeItem( String absolutePath ); String[] getLockTokens(); AbstractJcrNode getNodeByUUID( String uuid ); @Override AbstractJcrNode getNodeByIdentifier( String id ); AbstractJcrNode getRootNode(); String getUserID(); ValueFactory getValueFactory(); boolean hasPendingChanges(); Session impersonate( Credentials credentials ); void importXML( String parentAbsPath,
                           InputStream in,
                           int uuidBehavior ); boolean itemExists( String absolutePath ); void logout(); void move( String srcAbsPath,
                      String destAbsPath ); void refresh( boolean keepChanges ); void removeLockToken( String lockToken ); void save(); void reindexContent(); void reindexContent( String path,
                                int depth ); Snapshot getSnapshot(); @Override String toString(); @Override AccessControlManager getAccessControlManager(); @Override RetentionManager getRetentionManager();  }### Answer:
@Test( expected = IllegalArgumentException.class ) public void shouldNotAllowNoNamespacePrefix() throws Exception { session.getNamespaceURI(null); }
@Test( expected = NamespaceException.class ) public void shouldNotProvideUriForUnknownPrefix() throws Exception { session.getNamespaceURI("bogus"); }
@Test public void shouldProvideNamespaceUri() throws Exception { assertThat(session.getNamespaceURI("mode"), is("http: assertThat(session.getNamespaceURI("jcr"), is("http: assertThat(session.getNamespaceURI("mix"), is("http: assertThat(session.getNamespaceURI("nt"), is("http: assertThat(session.getNamespaceURI("sv"), is("http: }