### Question:
ItemVersionManagerImpl implements ItemVersionManager { @Override public Collection<ItemVersion> list(SessionContext context, Space space, Id itemId) { validateItemExistence(context, itemId); Response<Collection<ItemVersion>> response = getStateAdaptor(context).listItemVersions(context, space, itemId); ValidationUtil.validateResponse(response, logger, ErrorCode.ZU_ITEM_VERSION_LIST); return response.getValue(); }  @Override Collection<ItemVersion> list(SessionContext context, Space space, Id itemId); @Override boolean isExist(SessionContext context, Space space, Id itemId, Id versionId); @Override ItemVersion get(SessionContext context, Space space, Id itemId, Id versionId,
                         Id revisionId); @Override Id create(SessionContext context, Id itemId, Id baseVersionId,
                   ItemVersionData data); @Override Id create(SessionContext context, Id itemId, Id versionId, Id baseVersionId, ItemVersionData data); @Override void update(SessionContext context, Id itemId, Id versionId, ItemVersionData data); @Override void delete(SessionContext context, Id itemId, Id versionId); @Override ItemVersionStatus getStatus(SessionContext context, Id itemId, Id versionId); @Override void tag(SessionContext context, Id itemId, Id versionId, Id changeId, Tag tag); @Override void publish(SessionContext context, Id itemId, Id versionId, String message); @Override CoreMergeResult sync(SessionContext context, Id itemId, Id versionId); @Override CoreMergeResult forceSync(SessionContext context, Id itemId, Id versionId); @Override CoreMergeResult merge(SessionContext context, Id itemId, Id versionId,
                               Id sourceVersionId); @Override ItemVersionRevisions listRevisions(SessionContext context, Id itemId, Id versionId); @Override Revision getRevision(SessionContext context, Id itemId, Id versionId, Id revisionId); @Override void resetRevision(SessionContext context, Id itemId,
                            Id versionId, Id revisionId); @Override void revertRevision(SessionContext context, Id itemId,
                             Id versionId, Id revisionId); @Override void updateModificationTime(SessionContext context, Space space, Id itemId,
                                     Id versionId, Date modificationTime); @Override CoreItemVersionConflict getConflict(SessionContext context, Id itemId,
                                             Id versionId); @Override void saveMergeChange(SessionContext context, Space space, Id itemId,
                              ItemVersionChange itemVersionChange);  }### Answer:
@Test public void testList() { Id itemId = new Id(); List<ItemVersion> retrievedVersions = Arrays.asList( TestUtils.createItemVersion(new Id(), new Id(), "v1"), TestUtils.createItemVersion(new Id(), new Id(), "v2"), TestUtils.createItemVersion(new Id(), new Id(), "v3")); doReturn(true).when(itemManagerMock).isExist(anyObject(), anyObject()); doReturn(new Response<>(retrievedVersions)).when(stateAdaptorMock) .listItemVersions(context, Space.PRIVATE, itemId); Collection<ItemVersion> versions = itemVersionManagerImpl.list(context, Space.PRIVATE, itemId); Assert.assertEquals(versions, retrievedVersions); }
@Test(expectedExceptions = ZusammenException.class) public void testListOnNonExistingItem() { itemVersionManagerImpl.list(context, Space.PRIVATE, new Id()); }