tednaleid/build-test-data — pull request #38 by michaelcameron (2014-09-19 20:25:04+00:00)
Title: Handle circular references with class hierarchy

Build test data does not handle circular references with non-trivial class hierarchies.

Given:
```groovy
class CircularOne {
CircularTwo circularTwo
}

class CircularOneChild extends CircularOne {
}

class CircularTwo extends BaseMock {
CircularOne circularOne
}
```

`CircularOne.build()` will create a new `CircularOne` that has a `CircularTwo` that points back to that same instance of `CircularOne`. But `CircularOneChild.build()` will create a `CircularTwo` that creates and points to a new `CircularOne` that then points that same instance of `CircularTwo`.

This happens because the the circular check list logic relies on a `CircularCheckList` that extends hashmap with keys consisting of the full qualified class name. Changing that implementation to additionally add super classes that are also domain classes will result in multiple entries that will then be found by the relationships in the circular check.