topSpec.getCleanupMethod().addInterceptor(interceptor);
topSpec.getCleanupSpecMethod().addInterceptor(interceptor);
// set the last created Spec, so we can call AfterSuite only when this is done.
lastCreatedSpec = topSpec;
topSpec.addListener(new AbstractRunListener()
{
@Override
public void afterSpec(SpecInfo spec)
{
if(spec == lastCreatedSpec)