### Question:
ImageManager { public List<String> getVmImagesIds() { List<String> vmImagesIds = new ArrayList<>(); for (ImageUploaded imageDesc: cloudMiddleware.getVmImages()) { vmImagesIds.add(imageDesc.getId()); } return vmImagesIds; } ImageManager(CloudMiddleware cloudMiddleware); List<ImageUploaded> getVmImages(); String createVmImage(ImageToUpload imageToUpload); ImageUploaded getVmImage(String imageId); void deleteVmImage(String id); List<String> getVmImagesIds();  }### Answer:
@Test public void getVmImagesIds() { List<ImageUploaded> mockedCloudMiddlewareResponse = new ArrayList<>(); mockedCloudMiddlewareResponse.add(new ImageUploaded("image1", "imageName1", "active")); mockedCloudMiddlewareResponse.add(new ImageUploaded("image2", "imageName2", "active")); Mockito.when(mockedCloudMiddleware.getVmImages()).thenReturn(mockedCloudMiddlewareResponse); List<String> imagesIds = new ArrayList<>(); imagesIds.add("image1"); imagesIds.add("image2"); assertTrue(imageManager.getVmImagesIds().containsAll(imagesIds)); }