addNodes was only used for testing; replace it with a makeGraph method
in the test class.