// A second call using the imageId will fallback to the GetImageStrategy and populate the image in the cache.
assertNotNull(templateBuilder.imageId(image.getId()).build());
// The third call will succeed, as the previous one should have populated the image in the cache.
templateBuilder.imageId(null); // Clear all criteria
Template template = templateBuilder.osNameMatches(image.getOperatingSystem().getName()).build();
assertEquals(template.getImage().getId(), image.getId());
// Verify this is called only once, as the third call will already find the image in the cache
verify(getImageStrategy);
}