### Question:
VmmRestInputValidator { public void checkImageExists(String imageId, List<String> imagesIds) { if (!imagesIds.contains(imageId)) { throw new WebApplicationException(404); } }  void checkVmDescriptions(JsonObject vmsJson); void checkVmExists(boolean vmExists); void checkImageExists(String imageId, List<String> imagesIds); void checkImageDescription(ImageToUpload imageToUpload); void checkJsonActionFormat(JsonObject jsonObject); void checkHostExists(boolean hostExists);  }### Answer:
@Test public void checkImageShouldRaiseExceptionIfItDoesNotExist() { String[] imagesIds = {"imageId1", "imageId2"}; exception.expect(WebApplicationException.class); inputValidator.checkImageExists("imageId3", new ArrayList<>(Arrays.asList(imagesIds))); }
@Test public void checkImageShouldNotRaiseExceptionIfItExists() { String[] imagesIds = {"imageId1", "imageId2"}; inputValidator.checkImageExists("imageId1", new ArrayList<>(Arrays.asList(imagesIds))); }