NamespaceRegistryFacade implements NamespaceRegistry { @Override public String getURI(String prefix) throws RepositoryException { return delegate.getURI(prefix); } @SuppressWarnings("WeakerAccess")  NamespaceRegistryFacade(@NotNull NamespaceRegistry delegate); @Override String[] getPrefixes(); @Override String[] getURIs(); @Override String getURI(String prefix); @Override String getPrefix(String uri); @Override void registerNamespace(String prefix, String uri); @Override void unregisterNamespace(String prefix);  }
@Test public void testGetURI() throws Exception { NamespaceRegistry delegate = mock(NamespaceRegistry.class); NamespaceRegistryFacade facade = getFacade(delegate); final String prefix = NamespaceRegistry.PREFIX_JCR; final String uri = NamespaceRegistry.NAMESPACE_JCR; when(delegate.getURI(anyString())).thenReturn(null); when(delegate.getURI(prefix)).thenReturn(uri); assertNull("should be null", facade.getURI("")); assertSame("should be same", uri, facade.getURI(prefix)); }