Validate Task Graph

I need to refactor and break up a very large plugin that belongs to someone else. One thing that i absolutely can not do is change the existing task graph. I am trying to add baseline unit tests right now that i can use to verify i don’t change anything when i break this apart. Now plan A was to add the plugin task tree and pull a tree from testkit tests that compare the task trees with the expected. the problem is one of the task trees looks like this

:buildDocsHtml
+--- :installBuildRequirements
|    \--- :installSetupRequirements
|         \--- :installLinks
|              \--- :createVirtualEnvironment
|                   \--- :pinRequirements
\--- :installProject
     \--- :installTestRequirements
          \--- :installPythonRequirements
               \--- :installBuildRequirements
                    \--- :installSetupRequirements
                         \--- :installLinks
                              \--- :createVirtualEnvironment
                                   \--- :pinRequirements

Thats going to be a nightmare to try to compare as a string. Is there an easier way to pull this off?

May be you could use taskGraph.whenReady Together with some methods from the interface TaskExecutionGraph from Gradle API. There you can get e.g. a list of all tasks.