### Question:
DnNode { public synchronized boolean hasChildren() { return ( children != null ) && children.size() != 0; } DnNode();  DnNode( N element );  DnNode( Dn dn, N element ); synchronized boolean isLeaf(); synchronized boolean isLeaf( Dn dn ); synchronized int size(); synchronized N getElement(); synchronized N getElement( Dn dn ); synchronized boolean hasElement(); synchronized boolean hasElement( Dn dn ); synchronized boolean hasDescendantElement( Dn dn ); synchronized List<N> getDescendantElements( Dn dn ); synchronized boolean hasChildren(); synchronized boolean hasChildren( Dn dn ); synchronized Map<String, DnNode<N>> getChildren(); synchronized DnNode<N> getParent(); synchronized boolean hasParent(); synchronized boolean hasParent( Dn dn ); synchronized DnNode<N> add( Dn dn ); synchronized DnNode<N> add( Dn dn, N element ); synchronized void remove( Dn dn ); synchronized boolean contains( Rdn rdn ); synchronized DnNode<N> getChild( Rdn rdn ); synchronized Rdn getRdn(); synchronized DnNode<N> getNode( Dn dn ); synchronized boolean hasParentElement( Dn dn ); synchronized DnNode<N> getParentWithElement( Dn dn ); synchronized DnNode<N> getParentWithElement(); synchronized void rename( Rdn newRdn ); synchronized void move( Dn newParent ); @Override String toString(); synchronized Dn getDn();  }### Answer:
@Test public void testHasChildren() throws Exception { DnNode<Dn> tree = new DnNode<Dn>(); Dn dn1 = new Dn( "dc=b,dc=a" ); tree.add( dn1 ); assertTrue( tree.hasChildren() ); Map<String, DnNode<Dn>> children = tree.getChildren(); assertNotNull( children ); DnNode<Dn> child = children.get( new Rdn( "dc=a" ).getNormName() ); assertTrue( child.hasChildren() ); children = child.getChildren(); child = children.get( new Rdn( "dc=b" ).getNormName() ); assertFalse( child.hasChildren() ); }