### Question:
VideoImpl extends AbstractEmptyTextComponent implements Video { protected 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 boolean isEmpty(); @Override boolean isReady(); @Override String getSrc(); @Override boolean isVideoAsset(); @Nonnull @Override String getExportedType();  }### Answer:
@Test public void isLegacyMode_NoLegacyConfigOrLegacyMode() { ctx.currentResource("/content/video"); final Video video = ctx.request().adaptTo(Video.class); assertFalse(((VideoImpl) video).isLegacyMode()); }
@Test public void isLegacyMode_WithComputedPropertyAndNoLegacyMode() { ctx.currentResource("/content/legacy-computed-property"); final Video video = ctx.request().adaptTo(Video.class); assertTrue(((VideoImpl) video).isLegacyMode()); }
@Test public void isLegacyMode_WithRenditionRegexAndNoLegacyMode() { ctx.currentResource("/content/legacy-rendition-regex"); final Video video = ctx.request().adaptTo(Video.class); assertTrue(((VideoImpl) video).isLegacyMode()); }
@Test public void isLegacyMode_WithAllConfigsAndNoLegacyMode() { ctx.currentResource("/content/all-configs"); final Video video = ctx.request().adaptTo(Video.class); assertFalse(((VideoImpl) video).isLegacyMode()); }
@Test public void isLegacyMode_On() { ctx.currentResource("/content/legacy-on"); final Video video = ctx.request().adaptTo(Video.class); assertTrue(((VideoImpl) video).isLegacyMode()); }
@Test public void isLegacyMode_Off() { ctx.currentResource("/content/legacy-off"); final Video video = ctx.request().adaptTo(Video.class); assertFalse(((VideoImpl) video).isLegacyMode()); }