@Test public void prefixesN() {

    // All combinations.
    String data = StrUtils.strjoinNL
        ("@prefix : <http://example/> ." ,
         "@prefix ex: <http://example/ex#> ." ,
         "@prefix notinuse: <http://example/whatever/> ." ,
         "@prefix indirect: <urn:foo:> ." ,
         "@prefix indirectx: <urn:x:> ." ,
         "@prefix ns: <http://host/ns> ." ,
         "@prefix ns1: <http://host/ns1> ." ,
         "@prefix ns2: <http://host/nspace> ." ,
         "" ,
         ":s1 :p :x1 ." ,
         ":s1 ex:p :x1 ." ,
         "<urn:foo:bar> :p 1 . ",
         "<urn:x:a:b> :p 2 . ",
         "<urn:verybad#.> :p 1 . ",
         "ns:x ns1:p 'ns1' . ",
         "<http://examp/abberev> indirect:p 'foo' . "
         ) ;
    
    Graph graph = create(data) ;
    PrefixMapping pmap = PrefixMappingUtils.calcInUsePrefixMapping(graph) ;
    PrefixMapping pmapExpected = new PrefixMappingImpl() ;
 	pmapExpected.setNsPrefix("", "http://example/") ;
apExpected.setNsPrefix("ex", "http://example/ex#") ;
apExpected.setNsPrefix("indirect", "urn:foo:") ;
apExpected.setNsPrefix("ns", "http://host/ns") ;
apExpected.setNsPrefix("ns1", "http://host/ns1") ;
apExpected.setNsPrefix("indirectx", "urn:x:") ;
print("Expected:", pmapExpected) ;
print("Got:", pmap) ;
    Assert.assertTrue(sameMapping(pmapExpected, pmap)) ;
    Assert.assertTrue(pmap.getNsPrefixURI("notinuse") == null) ;
}