@Test
public void testGetAsStream() throws Exception {

	BufferedImage expected = getImage();
	ScreenshotImage image = new PersistedScreenshotImage(persister, metadata, expected);
	InputStream in = null;
	try {
		in = image.getAsStream();
		BufferedImage actual = ImageIO.read(in);
		assertThat(ImageUtils.imageEquals(expected, actual), is(true));
	} finally {
		if (in != null) {
			in.close();
		}
	}
	assertThat(image.isImageCached(), is(true));
}