package org.realityforge.arez.api2;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

public class Derivation
  extends Reaction
{
  Derivation( @Nonnull final ArezContext context,
              @Nullable final String name,
              @Nonnull final TransactionMode mode,
              @Nonnull final Action action )
  {
    super( context, name, mode, action );
  }
}

@@ -381,11 +381,388 @@
 n );%0A  %7D
+%0A%0A  /**%0A   * Ensure that state field and other fields of the Derivation are consistent.%0A   */%0A  final void invariantDerivationState()%0A  %7B%0A    invariantState();%0A    if ( isActive() )%0A    %7B%0A      Guards.invariant( () -%3E !getDependencies().isEmpty(),%0A                        () -%3E String.format( %22Derivation named '%25s' is active but has no dependencies.%22, getName() ) );%0A    %7D%0A  %7D
 %0A%7D%0A

Add invariant check