Graph class with tests