### Question:
IndexEntry { public IndexEntry( String newId ) { this( null, newId ); } IndexEntry( String newId );  IndexEntry( IndexEntry newParent, String newId ); IndexEntry getParent(); String getId(); String getTitle(); void setTitle( String newTitle ); List<IndexEntry> getChildEntries(); void setChildEntries( List<IndexEntry> entries ); IndexEntry getNextEntry(); IndexEntry getPrevEntry(); IndexEntry getFirstEntry(); IndexEntry getLastEntry(); IndexEntry getRootEntry(); String toString(); String toString( int depth );  }### Answer:
@Test public void testIndexEntry() { IndexEntry root = new IndexEntry( null ); assertIndexEntry( root, null, 0, null, null ); IndexEntry chapter1 = new IndexEntry( root, "chapter-1" ); assertIndexEntry( root, null, 1, null, null ); assertIndexEntry( chapter1, root, 0, null, null ); IndexEntry chapter2 = new IndexEntry( root, "chapter-2" ); assertIndexEntry( root, null, 2, null, null ); assertIndexEntry( chapter1, root, 0, null, chapter2 ); assertIndexEntry( chapter2, root, 0, chapter1, null ); chapter2.setTitle( "Title 2" ); assertTrue( chapter2.toString().contains( "Title 2" ) ); }