// check after transaction commit
Assert.assertEquals(ns1, connection.loadNamespaceByPrefix("ns1"));
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));
// clear cache and check again
persistence.clearCache();
Assert.assertEquals(ns1, connection.loadNamespaceByPrefix("ns1"));