/**
* Test method for {@link org.fcrepo.utilities.NamespaceContextImpl#getPrefixes(java.lang.String)}.
*/
@Test
public void testGetPrefixes() {
NamespaceContextImpl nsCtx = new NamespaceContextImpl();
String prefix = "foo";
String ns = "http://www.example.org/foo";
nsCtx.addNamespace(prefix, ns);
Iterator<String> it = nsCtx.getPrefixes(ns);
assertNotNull(it);
assertTrue(it.hasNext());
assertEquals(prefix, it.next());
try {
it.remove();
fail("remove() succeeded on what should be an unmodifiable Iterator.");
} catch(UnsupportedOperationException e) {}
assertFalse(it.hasNext());
it = nsCtx.getPrefixes("noMapping");
assertNotNull(it);
assertFalse(it.hasNext());
}