Refactor dependency tree test class.