manager.getCache().setCacheListener(statistics);
ImageInfo info = manager.getImageInfo(valid1, sessionContext);
assertNotNull(info);
ImageBuffered img1 = (ImageBuffered)manager.getImage(
info, ImageFlavor.BUFFERED_IMAGE, sessionContext);
assertNotNull(img1);
assertNotNull(img1.getBufferedImage());
ImageBuffered img2 = (ImageBuffered)manager.getImage(
info, ImageFlavor.BUFFERED_IMAGE, sessionContext);
//ImageBuffered does not have to be the same instance but we want at least the
//BufferedImage to be reused.
assertTrue("BufferedImage must be reused",
img1.getBufferedImage() == img2.getBufferedImage());
assertEquals(1, statistics.getImageCacheHits()); //1=BufferedImage
assertEquals(3, statistics.getImageCacheMisses()); //3=BufferedImage,Graphics2DImage,DOM
}