### Question:
ThrowingRecursionBehaviour implements FixtureBehaviour { @Override public SpecimenBuilder transform(SpecimenBuilder builder) { if (builder == null) { throw new IllegalArgumentException("builder"); } return new RecursionGuard(builder, new ThrowingRecursionHandler()); }  @Override SpecimenBuilder transform(SpecimenBuilder builder);  }### Answer:
@Test(expected = IllegalArgumentException.class) public void null_builder_throws_exception() { this.behaviour.transform(null); }
@Test public void returns_instance_of_recursion_guard() { SpecimenBuilder transformed = this.behaviour.transform(this.mockSpecimenBuilder); assertTrue(transformed instanceof RecursionGuard); }
@Test public void recursion_guard_is_given_the_builder() { RecursionGuard guard = (RecursionGuard)this.behaviour.transform(this.mockSpecimenBuilder); assertSame(guard.builder(), this.mockSpecimenBuilder); }
@Test public void recursion_guard_is_given_throwing_recursion_handler() { RecursionGuard guard = (RecursionGuard)this.behaviour.transform(this.mockSpecimenBuilder); assertTrue(guard.handler() instanceof ThrowingRecursionHandler); }