code: public static NamespaceRegistry getNamespaceRegistry(final Session session) {
          try {
              return requireNonNull(session.getWorkspace().getNamespaceRegistry(),
                      "Couldn't find namespace registry in repository!");
          } catch (final RepositoryException e) {
              throw new RepositoryRuntimeException(e);
          }
      }
docs: Return the {@link NamespaceRegistry} associated with the arg session.
  
  @param session containing the NamespaceRegistry
  @return NamespaceRegistry