@Test public void testWithPrefix$valid() throws Exception { final ImmutableNamespaces ns = this.sut.withPrefix(NS1, VALID_NAMESPACE); assertThat(ns,not(sameInstance(this.sut))); assertThat(ns.getDeclaredPrefixes(),containsInAnyOrder(NS1,DEFAULT_PR1,DEFAULT_PR2)); assertThat(ns.getNamespaceURI(NS1),equalTo(VALID_NAMESPACE)); assertThat(ns.getPrefix(VALID_NAMESPACE),equalTo(NS1)); assertThat(ns.getPrefixes(VALID_NAMESPACE),contains(NS1)); }
public ImmutableNamespaces withPrefix(String prefix, String namespaceURI) { Objects.requireNonNull(prefix, "Prefix cannot be null"); Objects.requireNonNull(namespaceURI, "Namespace URI cannot be null"); ImmutableNamespaces result=new ImmutableNamespaces(this.map); result.map.put(prefix, namespaceURI); return result; }
ImmutableNamespaces implements Namespaces { public ImmutableNamespaces withPrefix(String prefix, String namespaceURI) { Objects.requireNonNull(prefix, "Prefix cannot be null"); Objects.requireNonNull(namespaceURI, "Namespace URI cannot be null"); ImmutableNamespaces result=new ImmutableNamespaces(this.map); result.map.put(prefix, namespaceURI); return result; } }
ImmutableNamespaces implements Namespaces { public ImmutableNamespaces withPrefix(String prefix, String namespaceURI) { Objects.requireNonNull(prefix, "Prefix cannot be null"); Objects.requireNonNull(namespaceURI, "Namespace URI cannot be null"); ImmutableNamespaces result=new ImmutableNamespaces(this.map); result.map.put(prefix, namespaceURI); return result; } private  ImmutableNamespaces(Map<String,String> map);  ImmutableNamespaces(); }
ImmutableNamespaces implements Namespaces { public ImmutableNamespaces withPrefix(String prefix, String namespaceURI) { Objects.requireNonNull(prefix, "Prefix cannot be null"); Objects.requireNonNull(namespaceURI, "Namespace URI cannot be null"); ImmutableNamespaces result=new ImmutableNamespaces(this.map); result.map.put(prefix, namespaceURI); return result; } private  ImmutableNamespaces(Map<String,String> map);  ImmutableNamespaces(); ImmutableNamespaces withPrefix(String prefix, String namespaceURI); ImmutableNamespaces withoutPrefix(String... prefixes); @Override Set<String> getDeclaredPrefixes(); @Override String getNamespaceURI(String prefix); @Override String getPrefix(String namespaceURI); @Override List<String> getPrefixes(String namespaceURI); @Override String toString(); }
ImmutableNamespaces implements Namespaces { public ImmutableNamespaces withPrefix(String prefix, String namespaceURI) { Objects.requireNonNull(prefix, "Prefix cannot be null"); Objects.requireNonNull(namespaceURI, "Namespace URI cannot be null"); ImmutableNamespaces result=new ImmutableNamespaces(this.map); result.map.put(prefix, namespaceURI); return result; } private  ImmutableNamespaces(Map<String,String> map);  ImmutableNamespaces(); ImmutableNamespaces withPrefix(String prefix, String namespaceURI); ImmutableNamespaces withoutPrefix(String... prefixes); @Override Set<String> getDeclaredPrefixes(); @Override String getNamespaceURI(String prefix); @Override String getPrefix(String namespaceURI); @Override List<String> getPrefixes(String namespaceURI); @Override String toString();  }