### Question:
DnNode { public synchronized boolean contains( Rdn rdn ) { return children.containsKey( rdn.getNormName() ); } 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 testContains() throws Exception { DnNode<Dn> tree = new DnNode<Dn>(); Dn dn = new Dn( "dc=c,dc=b,dc=a" ); tree.add( dn, dn ); Rdn rdnA = new Rdn( "dc=a" ); Rdn rdnB = new Rdn( "dc=b" ); Rdn rdnC = new Rdn( "dc=c" ); assertTrue( tree.contains( rdnA ) ); assertFalse( tree.contains( rdnB ) ); assertFalse( tree.contains( rdnC ) ); DnNode<Dn> child = tree.getChild( rdnA ); assertFalse( child.contains( rdnA ) ); assertTrue( child.contains( rdnB ) ); assertFalse( child.contains( rdnC ) ); child = child.getChild( rdnB ); assertFalse( child.contains( rdnA ) ); assertFalse( child.contains( rdnB ) ); assertTrue( child.contains( rdnC ) ); }