anchor.diff:  <% end -%>
   
     @org.testng.annotations.BeforeMethod
  +<% if repository.arez? -%>
  +  @java.lang.Override
  +<% end -%>
     public void preTest()
       throws Exception
     {
   <% if repository.arez? -%>
  -    org.realityforge.braincheck.BrainCheckTestUtil.resetConfig( false );
  -    arez.ArezTestUtil.resetConfig( false );
  +    arez.testng.ArezTestSupport.super.preTest();
   <% if repository.imit? -%>
       replicant.ReplicantTestUtil.resetConfig( false );
   <% if repository.imit.enable_entity_broker? -%>
  
positive.code: <% if repository.arez? -%>
  
    @org.testng.annotations.AfterMethod
    protected void afterTest()
      throws Exception
    {
      super.postTest();
  <% if repository.arez? -%>
  <% if repository.imit? -%>
      replicant.ReplicantTestUtil.resetConfig( false );
  <% end -%>
      arez.ArezTestUtil.resetConfig( true );
      org.realityforge.braincheck.BrainCheckTestUtil.resetConfig( true );
      if ( !_ignoreObserverErrors && !_observerErrors.isEmpty() )
      {
        org.testng.Assert.fail( "Unexpected Observer Errors: " + _observerErrors.stream().collect( java.util.stream.Collectors.joining( "\n" ) ) );
      }
  <% end -%>
    }
  <% end -%>
  
  <% end -%>
  <% if repository.arez? -%>
    protected static void observeDependency()
    {
      arez.Arez.context().observable().reportObserved();
    }
  
    @javax.annotation.Nonnull
    protected final arez.Disposable pauseScheduler()
    {
      return arez.Arez.context().pauseScheduler();
    }
  
    protected final void autorun( @javax.annotation.Nonnull final arez.Procedure procedure )
    {
      arez.Arez.context().observer( () -> {
        observeDependency();
        procedure.call();
      } );
    }
  
    protected final void action( @javax.annotation.Nonnull final arez.Procedure action )
      throws Throwable
    {
      arez.Arez.context().action( action );
    }
  
    protected final <T> T action( @javax.annotation.Nonnull final arez.Function<T> action )
      throws Throwable
    {
      return arez.Arez.context().action( action );
    }
  
    protected final void safeAction( @javax.annotation.Nonnull final arez.SafeProcedure action )
    {
      arez.Arez.context().safeAction( action );
    }
  
    protected final <T> T safeAction( @javax.annotation.Nonnull final arez.SafeFunction<T> action )
    {
      return arez.Arez.context().safeAction( action );
    }
  
    protected final void setIgnoreObserverErrors( final boolean ignoreObserverErrors )
    {
      _ignoreObserverErrors = ignoreObserverErrors;
    }
  
    protected final void setPrintObserverErrors( final boolean printObserverErrors )
    {
      _printObserverErrors = printObserverErrors;
    }
  
    private void onObserverError( @javax.annotation.Nonnull final arez.Observer observer,
                                  @javax.annotation.Nonnull final arez.ObserverError error,
                                  @javax.annotation.Nullable final Throwable throwable )
    {
      if ( !_ignoreObserverErrors )
      {
        final String message = "Observer: " + observer.getName() + " Error: " + error + " " + throwable;
        _observerErrors.add( message );
        if ( _printObserverErrors )
        {
          System.out.println( message );
        }
      }
    }
  <% end -%>
  <% repository.gwt.test_class_contents.each do |content| -%>
  
negative.code:     replicant.ReplicantTestUtil.resetState();
  <% end -%>
  <% end -%>
  <% end -%>
      super.preTest();
  <% repository.gwt.test_factories.each do |short_code, classname| -%>
  