### Question:
ChildrenMenuCollector implements Collector { @Override public boolean isCollectible(final ApplicationMenu menu) { return parentId.equals(menu.getParentId()); } ChildrenMenuCollector(final Long parentId); @Override boolean isCollectible(final ApplicationMenu menu);  }### Answer:
@Test public void should_be_collectible_when_menu_parentId_is_the_given_parentId() { menu.setParentId(1L); assertThat(collector.isCollectible(menu)).isTrue(); }
@Test public void should_not_be_collectible_when_menu_parentId_is_not_the_given_parentId() { menu.setParentId(2L); assertThat(collector.isCollectible(menu)).isFalse(); }
@Test public void should_not_be_collectible_when_menu_parentId_is_null() { menu.setParentId(null); assertThat(collector.isCollectible(menu)).isFalse(); }