### Question:
BylineImpl implements Byline { @Override public List<String> getOccupations() { if (occupations != null) { Collections.sort(occupations); return occupations; } else { return Collections.emptyList(); } }  @Override String getName(); @Override List<String> getOccupations(); @Override boolean isEmpty();  }### Answer:
@Test public void testGetOccupations() { List<String> expected = new ImmutableList.Builder<String>() .add("Blogger") .add("Photographer") .add("YouTuber") .build(); ctx.currentResource("/content/byline"); Byline byline = ctx.request().adaptTo(Byline.class); List<String> actual = byline.getOccupations(); assertEquals(expected, actual); }
@Test public void testGetOccupations_WithoutOccupations() { List<String> expected = Collections.emptyList(); ctx.currentResource("/content/empty"); Byline byline = ctx.request().adaptTo(Byline.class); List<String> actual = byline.getOccupations(); assertEquals(expected, actual); }