Tests the graph class.