Refactor benchmark tests: extract graph scenarios from the test, and also extract an abstract test superclass.