Assert.assertEquals(ns1, connection.loadNamespaceByUri("http://localhost/ns1/"));
Assert.assertEquals(ns2, connection.loadNamespaceByPrefix("ns2"));
Assert.assertEquals(ns2, connection.loadNamespaceByUri("http://localhost/ns2/"));
Assert.assertThat(Iterations.asList(connection.listNamespaces()),hasItems(ns1,ns2));
connection.commit();
// check after transaction commit
Assert.assertEquals(ns1, connection.loadNamespaceByPrefix("ns1"));
Assert.assertEquals(ns1, connection.loadNamespaceByUri("http://localhost/ns1/"));
Assert.assertEquals(ns2, connection.loadNamespaceByPrefix("ns2"));