### Question:
TreeFacetField implements Comparable<TreeFacetField>, Serializable, Cloneable { public boolean hasChildren() { return hierarchy != null && hierarchy.size() > 0; } TreeFacetField(String label, String value, long count, long childCount, SortedSet<TreeFacetField> hierarchy); String getLabel(); String getValue(); long getCount(); long getChildCount(); long getTotal(); SortedSet<TreeFacetField> getHierarchy(); boolean hasChildren(); long recalculateChildCount(); @Override int compareTo(TreeFacetField o); SimpleOrderedMap<Object> toMap(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); @Override TreeFacetField clone();  }### Answer:
@Test public void hasChildren_nullHierarchy() { TreeFacetField test = new TreeFacetField("label", "value", 0, 0, null); assertFalse(test.hasChildren()); }
@Test public void hasChildren_emptyHierarchy() { final SortedSet<TreeFacetField> hierarchy = new TreeSet<>(); TreeFacetField test = new TreeFacetField("label", "value", 0, 0, hierarchy); assertFalse(test.hasChildren()); }
@Test public void hasChildren_withHierarchy() { final SortedSet<TreeFacetField> hierarchy = new TreeSet<>(); final TreeFacetField child = new TreeFacetField("label", "value", 0, 0, null); hierarchy.add(child); TreeFacetField test = new TreeFacetField("label", "value", 0, 0, hierarchy); assertTrue(test.hasChildren()); }