...and if you really want to iterate over the keys, look at the source for OutlineViewer. I recall that the listener for updates fires off for all existing NetworkTables values when you first connect to the network tables server.
We wrote a server to log data in the network tables to the driver's station disk last year. It was really hard on bandwidth, so we are just logging in the roboRIO this year. The source code for that might help for how to determine what is in the NetworkTables tree.
https://github.com/fovea1959/FRC3620...ggerNoGUI.java