ScreenshotImage { public BufferedImage get() { if (image == null) { throw new IllegalStateException("image is null"); } return image; } ScreenshotImage();  ScreenshotImage(BufferedImage image); boolean isImageCached(); BufferedImage get(); InputStream getAsStream(); @Override String toString();  }
@Test public void testGet() throws Exception { ScreenshotImage si = new ScreenshotImage(image); assertThat(si.get(), is(image)); }