### Question:
ImageAndMask implements Serializable { public void validate() throws IllegalArgumentException { if (imageUrl == null) { throw new IllegalArgumentException("no imageUrl specified"); } final URI imageUri = getUri(imageUrl); validateFile(imageUri, "imageUrl"); validatedImageUrl = getUrlString(imageUri); if (maskUrl != null) { final URI maskUri = getUri(maskUrl); validateFile(maskUri, "maskUrl"); validatedMaskUrl = getUrlString(maskUri); } } ImageAndMask();  ImageAndMask(final String imageUrl,
                        final String maskUrl);  ImageAndMask(final File imageFile,
                        final File maskFile); boolean hasImage(); String getImageUrl(); String getImageFilePath(); boolean hasMask(); String getMaskUrl(); String getMaskFilePath(); @Override String toString(); void validate();  }### Answer:
@Test(expected = IllegalArgumentException.class) public void testValidateWithNullImage() throws Exception { ImageAndMask imageAndMask = new ImageAndMask(); imageAndMask.validate(); }
@Test(expected = IllegalArgumentException.class) public void testValidateWithInvalidImageUrl() throws Exception { ImageAndMask imageAndMask = new ImageAndMask("scheme-with-invalid-@-char: imageAndMask.validate(); }
@Test(expected = IllegalArgumentException.class) public void testValidateWithMissingImageFileWithScheme() throws Exception { ImageAndMask imageAndMask = new ImageAndMask("file: imageAndMask.validate(); }
@Test(expected = IllegalArgumentException.class) public void testValidateWithMissingImageFileWithoutScheme() throws Exception { ImageAndMask imageAndMask = new ImageAndMask("/missing-file", null); imageAndMask.validate(); }