### Question:
ImageManager { public ImageUploaded getVmImage(String imageId) { return cloudMiddleware.getVmImage(imageId); } 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 getVmImage() { ImageUploaded mockedCloudMiddlewareResponse = new ImageUploaded("imageId", "imageName", "active"); Mockito.when(mockedCloudMiddleware.getVmImage("queryImageId")).thenReturn(mockedCloudMiddlewareResponse); assertEquals(mockedCloudMiddlewareResponse, imageManager.getVmImage("queryImageId")); }
@Test public void getVmImageReturnsNullWhenItDoesNotExist() { Mockito.when(mockedCloudMiddleware.getVmImage("queryImageId")).thenReturn(null); assertNull(imageManager.getVmImage("queryImageId")); }