@Test
public void putOntWithSharedExternalImportTest() {

    cache.put(key3, ontMultipleImports);
    cache.put(key2, ontOneImport);
    try (RepositoryConnection connection = repo.getConnection()) {
        List<Resource> contexts = RepositoryResults.asList(connection.getContextIDs());
        assertEquals(7, contexts.size());
        assertTrue(contexts.contains(vf.createIRI("http://mobi.com/dataset/" + ResourceUtils.encode(key3))));
        assertTrue(contexts.contains(vf.createIRI("http://mobi.com/dataset/" + ResourceUtils.encode(key2))));
        assertTrue(contexts.contains(vf.createIRI("http://mobi.com/dataset/" + ResourceUtils.encode(key3) + SYSTEM_DEFAULT_NG_SUFFIX)));
        assertTrue(contexts.contains(vf.createIRI("http://mobi.com/dataset/" + ResourceUtils.encode(key2) + SYSTEM_DEFAULT_NG_SUFFIX)));
        assertTrue(contexts.contains(import1SdNgIRI));
        assertTrue(contexts.contains(import2SdNgIRI));
        assertTrue(contexts.contains(import3SdNgIRI));
    }
}