public abstract class Node {
List children;
public List getChidren() {
if (children == null) {
children = new ArrayList<>();
}
return chidren;
}
}
As simple as it gets and very easy to use. To use it, extend it:
public class MenuItem extends Node {
String label;
String href;
...
}