### Question:
ConfigurationColumnViewItem { public boolean hasChildren() { if (isCommerceBucket()) return false; boolean isContainer = isConfigurationContainer(); boolean hasChildren = resource.hasChildren(); boolean hasMoreChildren = getChildCount(resource) > 1; boolean hasSettings = resource.getChild("settings") != null; return isContainer && (hasCommerceSetting || hasMoreChildren) || !isContainer && !hasCommerceSetting && (hasChildren && !hasSettings || hasMoreChildren && hasSettings); }  @PostConstruct void initModel(); String getTitle(); boolean hasChildren(); List<String> getQuickActionsRel();  }### Answer:
@Test public void testHasChildrenOnConfiguration() { context.currentResource(context.resourceResolver().getResource(CONFIGURATION_PATH)); ConfigurationColumnViewItem columnViewItem = context.request().adaptTo(ConfigurationColumnViewItem.class); Assert.assertFalse("Configuration doesn't have children", columnViewItem.hasChildren()); }
@Test public void testHasChildrenOnConfigurationParent() { context.currentResource(context.resourceResolver().getResource("/conf/testing")); ConfigurationColumnViewItem columnViewItem = context.request().adaptTo(ConfigurationColumnViewItem.class); Assert.assertTrue("Configuration parent has children", columnViewItem.hasChildren()); }
@Test public void testHasChildrenOnEmptyFolder() { context.currentResource(context.resourceResolver().getResource("/conf/folder1")); ConfigurationColumnViewItem columnViewItem = context.request().adaptTo(ConfigurationColumnViewItem.class); Assert.assertFalse("Empty folder has no children", columnViewItem.hasChildren()); }
@Test public void testHasChildrenOnEmptyConfigFolder() { context.currentResource(context.resourceResolver().getResource("/conf/folder2")); ConfigurationColumnViewItem columnViewItem = context.request().adaptTo(ConfigurationColumnViewItem.class); Assert.assertFalse("Empty config folder has no children", columnViewItem.hasChildren()); }
@Test public void testHasChildrenOnNonEmptyConfigFolder() { context.currentResource(context.resourceResolver().getResource("/conf/folder4")); ConfigurationColumnViewItem columnViewItem = context.request().adaptTo(ConfigurationColumnViewItem.class); Assert.assertTrue("Empty config folder has no children", columnViewItem.hasChildren()); }