SimpleNamespaceContext implements NamespaceContext { public void setBindings(Map<String, String> bindings) { for (Map.Entry<String, String> entry : bindings.entrySet()) { bindNamespaceUri(entry.getKey(), entry.getValue()); } }  @Override String getNamespaceURI(String prefix); @Override String getPrefix(String namespaceUri); @Override Iterator<String> getPrefixes(String namespaceUri); void setBindings(Map<String, String> bindings); void bindDefaultNamespaceUri(String namespaceUri); void bindNamespaceUri(String prefix, String namespaceUri); void clear(); Iterator<String> getBoundPrefixes(); void removeBinding(String prefix); boolean hasBinding(String prefix);  }
@Test public void testSetBindings() throws Exception { context.setBindings(Collections.singletonMap("prefix", "namespace")); Assert.assertEquals("Invalid namespace uri", "namespace", context.getNamespaceURI("prefix")); }