title: Creating recursive tree with AutoFixture
body: <p>I have just started using AutoFixture and have this semi-complex data structure that I would like to  create some specimen for. 
  In the tests I am working with I don't care too much about content of the data structure. I just want reasonable default values.</p>
  
  <p>Part of this data structure is a recursive tree. More specific, one class holds a collection of some other class that contains a list of children of itself.
  Something akin to:</p>
  
  <pre><code>public class A
  {
     private IEnumerable&lt;B&gt; bNodes;
     public A(IEnumerable&lt;B&gt; bNodes)
     {
        this.bNodes = bNodes;
     }
  }
  
  public class B
  {
     private IEnumerable&lt;B&gt; children;
     public B(IEnumerable&lt;B&gt; children)
     {
        this.children = children;
     }
  }
  </code></pre>
  
  <p>Lets assume I cannot easily change this structure for various reasons.</p>
  
  <p>If I ask my fixture to create A ThrowingRecursionBehavior will start barking about B being recursive.</p>
  
  <p>If I replace ThrowingRecursionBehavior with OmitOnRecursionBehavior I get an ObjectCreateException.</p>
  
  <p>If I try something like: fixture.Inject(Enumerable.Empty()); I get "An item with the same key has already been added" from the DictionaryFiller. The same thing happens if I replace ThrowingRecursionBehavior with NullRecursionBehavior.</p>
  
  <p>There are several things I would like to.</p>
  
  <ul>
  <li>What would be the best way to create a specimen of A with an empty list of Bs?</li>
  <li>What would be the best way to create a specimen of A with a few Bs containing a few B-children with a few children (a small tree)?</li>
  </ul>
  
  <p>For my last wish it could be nice to specify some recursion depth after which Enumerable.Empty was used (or a zero sized array / List or even null).
  I know that AutoFixture is very flexible to extend. So I suppose it should be possible to create some specimen builder that does exactly this.
  In fact I will try fooling around with a custom ISpecimenBuilder, but perhaps someone has a smarter solution already.
  For example, would it make sense to modify this line in RecursionGuard:</p>
  
  <pre><code>public object Create(object request, ISpecimenContext context)
  {
     if (this.monitoredRequests.Any(x =&gt; this.comparer.Equals(x, request)))
     ...
  </code></pre>
  
  <p>to</p>
  
  <pre><code>public object Create(object request, ISpecimenContext context)
  {
     if (this.monitoredRequests.Count(x =&gt; this.comparer.Equals(x, request)) &gt; maxAllowedRecursions)
     ...
  </code></pre>