@Test
public void testGetVersions() throws Exception {

    // Setup:
    VersionedRecord record = versionedRecordFactory.createNew(VERSIONED_RECORD_IRI);
    Version version = versionFactory.createNew(VERSION_IRI);
    record.setVersion(Collections.singleton(version));
    doReturn(record).when(utilsService).getRecord(eq(distributedCatalogId), eq(VERSIONED_RECORD_IRI), eq(versionedRecordFactory), any(RepositoryConnection.class));
    Set<Version> versions = manager.getVersions(distributedCatalogId, VERSIONED_RECORD_IRI);
    verify(utilsService).getRecord(eq(distributedCatalogId), eq(VERSIONED_RECORD_IRI), eq(versionedRecordFactory), any(RepositoryConnection.class));
    record.getVersion_resource().forEach(resource -> verify(utilsService).getExpectedObject(eq(resource), eq(versionFactory), any(RepositoryConnection.class)));
    assertEquals(1, versions.size());
}