### Question:
ImageImpl extends AbstractEmptyTextComponent implements Image { boolean isLegacyMode() { if (legacyMode == null) { if (StringUtils.isNotBlank(renditionName)) { return false; } else { return StringUtils.isNotBlank(computedProperty) || StringUtils.isNotBlank(renditionRegex); } } else { return legacyMode; } }  @PostConstruct void init(); @Override String getSrc(); @Override String getAlt(); @Override String getFallback(); @Override boolean isEmpty(); @Override boolean isReady(); @Nonnull @Override String getExportedType();  }### Answer:
@Test public void isLegacyMode_NoLegacyConfigOrLegacyMode() { ctx.currentResource("/content/image"); final Image image = ctx.request().adaptTo(Image.class); assertFalse(((ImageImpl) image).isLegacyMode()); }
@Test public void isLegacyMode_WithComputedPropertyAndNoLegacyMode() { ctx.currentResource("/content/legacy-computed-property"); final Image image = ctx.request().adaptTo(Image.class); assertTrue(((ImageImpl) image).isLegacyMode()); }
@Test public void isLegacyMode_WithRenditionRegexAndNoLegacyMode() { ctx.currentResource("/content/legacy-rendition-regex"); final Image image = ctx.request().adaptTo(Image.class); assertTrue(((ImageImpl) image).isLegacyMode()); }
@Test public void isLegacyMode_WithAllConfigsAndNoLegacyMode() { ctx.currentResource("/content/all-configs"); final Image image = ctx.request().adaptTo(Image.class); assertFalse(((ImageImpl) image).isLegacyMode()); }
@Test public void isLegacyMode_On() { ctx.currentResource("/content/legacy-on"); final Image image = ctx.request().adaptTo(Image.class); assertTrue(((ImageImpl) image).isLegacyMode()); }
@Test public void isLegacyMode_Off() { ctx.currentResource("/content/legacy-off"); final Image image = ctx.request().adaptTo(Image.class); assertFalse(((ImageImpl) image).isLegacyMode()); }