### Question:
BylineImpl implements Byline { @Override public boolean isEmpty() { final Image image = getImage(); if (StringUtils.isBlank(name)) { return true; } else if (occupations == null || occupations.isEmpty()) { return true; } else if (image == null || StringUtils.isBlank(image.getSrc())) { return true; } else { return false; } }  @Override String getName(); @Override List<String> getOccupations(); @Override boolean isEmpty();  }### Answer:
@Test public void testIsEmpty() { ctx.currentResource("/content/empty"); Byline byline = ctx.request().adaptTo(Byline.class); assertTrue(byline.isEmpty()); }
@Test public void testIsEmpty_WithoutName() { ctx.currentResource("/content/without-name"); Byline byline = ctx.request().adaptTo(Byline.class); assertTrue(byline.isEmpty()); }
@Test public void testIsEmpty_WithoutOccupations() { ctx.currentResource("/content/without-occupations"); Byline byline = ctx.request().adaptTo(Byline.class); assertTrue(byline.isEmpty()); }
@Test public void testIsEmpty_WithEmptyArrayOfOccupations() { ctx.currentResource("/content/without-occupations-empty-array"); Byline byline = ctx.request().adaptTo(Byline.class); assertTrue(byline.isEmpty()); }
@Test public void testIsEmpty_WithoutImage() { ctx.currentResource("/content/byline"); when(modelFactory.getModelFromWrappedRequest(eq(ctx.request()), any(Resource.class), eq(Image.class))).thenReturn(null); Byline byline = ctx.request().adaptTo(Byline.class); assertTrue(byline.isEmpty()); }
@Test public void testIsEmpty_WithoutImageSrc() { ctx.currentResource("/content/byline"); when(image.getSrc()).thenReturn(""); Byline byline = ctx.request().adaptTo(Byline.class); assertTrue(byline.isEmpty()); }
@Test public void testIsNotEmpty() { ctx.currentResource("/content/byline"); when(image.getSrc()).thenReturn("/content/bio.png"); Byline byline = ctx.request().adaptTo(Byline.class); assertFalse(byline.isEmpty()); }