Well, a tree
could be a map of lists, but then a map could just be a set of lists each constrained to two elements, and a set is just a list with a uniqueness constraint. So we started at Java and ended up with LISP
In practice the basic set of operations on a tree node: ( get parent, get value, get children )don't line up very well with any of the other java.util types, which is why we have:
java.io.File, XML DOM, javax.swing.TreeModel, all of JNDI, JDOM etc. etc. all of which implement different,
completely incompatible tree structures. And more are being written every day.
Let's stop this madness. Imagine if there was a simple, very minimal Tree (a.k.a TreeNode, since trees are by nature recursive) interface in java.util defining the above three basic operations.
All those treelike APIs could implement this basic interface, then we could write generic tree-traversal algorithms, and (for example) simply switch at runtime whether tre-structured config information comes from XML via DOM or JDOM, or from JNDI, or from a file system of properties files, or from an IMAP server mailbox structure via JavaMail ...