### Question:
MergingPrefixDeclarationRegistry extends AbstractPrefixDeclarationRegistry { @Override public void setBaseIri(String baseIri) { Validate.notNull(baseIri, "baseIri must not be null"); if (baseIri == this.baseIri) { return; } if (this.baseIri == null) { this.baseIri = baseIri; } else if (this.baseIri == PrefixDeclarationRegistry.EMPTY_BASE) { prefixes.put(getFreshPrefix(), baseIri); } else { prefixes.put(getFreshPrefix(), this.baseIri); this.baseIri = baseIri; } } MergingPrefixDeclarationRegistry();  MergingPrefixDeclarationRegistry(final PrefixDeclarationRegistry prefixDeclarations); @Override void setBaseIri(String baseIri); @Override void setPrefixIri(String prefixName, String prefixIri); void mergePrefixDeclarations(final PrefixDeclarationRegistry other);  }### Answer:
@Test public void setBaseIri_changingBase_succeeds() { prefixDeclarations.setBaseIri(BASE); assertEquals(BASE, prefixDeclarations.getBaseIri()); prefixDeclarations.setBaseIri(MORE_SPECIFIC); assertEquals(MORE_SPECIFIC, prefixDeclarations.getBaseIri()); }
@Test public void setBaseIri_redeclareSameBase_succeeds() { prefixDeclarations.setBaseIri(BASE); assertEquals(BASE, prefixDeclarations.getBaseIri()); prefixDeclarations.setBaseIri(BASE); assertEquals(BASE, prefixDeclarations.getBaseIri()); }
@Test public void absolutizeIri_base_absoluteIri() throws PrefixDeclarationException { prefixDeclarations.setBaseIri(BASE); assertEquals(BASE + RELATIVE, prefixDeclarations.absolutizeIri(RELATIVE)); }