Define an IndexTree class such that each node has data fields to store a word, the count of occurences of that work in a document file, and the line number for each occurrence. Use an ArrayList to store the line numbers. Use an IndexTree object to store an index of words appearing in a text file, and then display the index by performing an inorder traversal of this tree.