FlowerDrawer implements RainbowImage.LoadPictureListener { public void init() { for (Integer leafRes : flower.getFlowerLeafRes()) { rainbowDrawer.loadImage(leafRes, Modes.LoadMode.LOAD_ORIGINAL_SIZE, this); } } FlowerDrawer(Flower flower, List<RainbowImage> flowerImages, RainbowDrawer rainbowDrawer); static FlowerDrawer newInstance(Flower flower, RainbowDrawer rainbowDrawer); void init(); @Override void onLoadSucceed(RainbowImage imageLoaded); @Override void onLoadFail(); void paintFlowerFor(Branch branch);  }
@Test public void testThatInitDoesLoadImageForEveryImageOnFlower() { flowerDrawer.init(); for (Integer flowerImageId : flowerToPaint.getFlowerLeafRes()) { verify(rainbowDrawer).loadImage(flowerImageId, Modes.LoadMode.LOAD_ORIGINAL_SIZE, flowerDrawer); } }