Bug: method needs to be static.  But this doesn't work anyway because the node isn't passed by reference in java.