// Path: src/test/java/net/jodah/sarge/AbstractTest.java
// public abstract class AbstractTest {
//   protected Sarge sarge;
// 
//   @BeforeMethod
//   protected void beforeMethod() {
//     sarge = new Sarge();
//   }
// }
// 
// Path: src/main/java/net/jodah/sarge/Directive.java
// public class Directive {
//   /**
//    * Resume supervision, re-throwing the failure from the point of invocation if a result is
//    * expected.
//    */
//   public static final Directive Resume = new Directive() {
//     @Override
//     public String toString() {
//       return "Resume Directive";
//     }
//   };
// 
//   /** Re-throws the failure from the point of invocation. */
//   public static final Directive Rethrow = new Directive() {
//     @Override
//     public String toString() {
//       return "Rethrow Directive";
//     }
//   };
// 
//   /** Escalates the failure to the supervisor of the supervisor. */
//   public static final Directive Escalate = new Directive() {
//     @Override
//     public String toString() {
//       return "Escalate Directive";
//     }
//   };
// 
//   /** Retries the method invocation. */
//   public static Directive Retry(int maxRetries, Duration retryWindow) {
//     return new RetryDirective(maxRetries, retryWindow);
//   }
// 
//   /** Retries the method invocation. */
//   public static Directive Retry(int maxRetries, Duration retryWindow,
//       Duration initialRetryInterval, double backoffExponent, Duration maxRetryInterval) {
//     return new RetryDirective(maxRetries, retryWindow, initialRetryInterval, backoffExponent,
//         maxRetryInterval);
//   }
// }
// 
// Path: src/main/java/net/jodah/sarge/Plan.java
// public interface Plan {
//   /**
//    * Applies the plan to the {@code failure} returning a {@link Directive}.
//    * 
//    * @param failure to handle
//    * @return Directive to carry out
//    */
//   Directive apply(Throwable failure);
// }
// 
// Path: src/main/java/net/jodah/sarge/SelfSupervisor.java
// public interface SelfSupervisor {
//   /** Returns the plan to be used when supervising itself. */
//   Plan selfPlan();
// }
// 
// Path: src/main/java/net/jodah/sarge/Supervisor.java
// public interface Supervisor {
//   /** Returns the plan to be used when supervising child objects. */
//   Plan plan();
// }


import net.jodah.sarge.AbstractTest;
import net.jodah.sarge.Directive;
import net.jodah.sarge.Plan;
import net.jodah.sarge.SelfSupervisor;
import net.jodah.sarge.Supervisor;
import org.testng.annotations.Test;
package net.jodah.sarge.functional;



/**
 * @author Jonathan Halterman
 */
@Test
public class SupervisorOverride extends AbstractTest {
// Path: src/test/java/net/jodah/sarge/AbstractTest.java
// public abstract class AbstractTest {
//   protected Sarge sarge;
// 
//   @BeforeMethod
//   protected void beforeMethod() {
//     sarge = new Sarge();
//   }
// }
// 
// Path: src/main/java/net/jodah/sarge/Directive.java
// public class Directive {
//   /**
//    * Resume supervision, re-throwing the failure from the point of invocation if a result is
//    * expected.
//    */
//   public static final Directive Resume = new Directive() {
//     @Override
//     public String toString() {
//       return "Resume Directive";
//     }
//   };
// 
//   /** Re-throws the failure from the point of invocation. */
//   public static final Directive Rethrow = new Directive() {
//     @Override
//     public String toString() {
//       return "Rethrow Directive";
//     }
//   };
// 
//   /** Escalates the failure to the supervisor of the supervisor. */
//   public static final Directive Escalate = new Directive() {
//     @Override
//     public String toString() {
//       return "Escalate Directive";
//     }
//   };
// 
//   /** Retries the method invocation. */
//   public static Directive Retry(int maxRetries, Duration retryWindow) {
//     return new RetryDirective(maxRetries, retryWindow);
//   }
// 
//   /** Retries the method invocation. */
//   public static Directive Retry(int maxRetries, Duration retryWindow,
//       Duration initialRetryInterval, double backoffExponent, Duration maxRetryInterval) {
//     return new RetryDirective(maxRetries, retryWindow, initialRetryInterval, backoffExponent,
//         maxRetryInterval);
//   }
// }
// 
// Path: src/main/java/net/jodah/sarge/Plan.java
// public interface Plan {
//   /**
//    * Applies the plan to the {@code failure} returning a {@link Directive}.
//    * 
//    * @param failure to handle
//    * @return Directive to carry out
//    */
//   Directive apply(Throwable failure);
// }
// 
// Path: src/main/java/net/jodah/sarge/SelfSupervisor.java
// public interface SelfSupervisor {
//   /** Returns the plan to be used when supervising itself. */
//   Plan selfPlan();
// }
// 
// Path: src/main/java/net/jodah/sarge/Supervisor.java
// public interface Supervisor {
//   /** Returns the plan to be used when supervising child objects. */
//   Plan plan();
// }


// Path: src/test/java/net/jodah/sarge/functional/SupervisorOverride.java
import net.jodah.sarge.AbstractTest;
import net.jodah.sarge.Directive;
import net.jodah.sarge.Plan;
import net.jodah.sarge.SelfSupervisor;
import net.jodah.sarge.Supervisor;
import org.testng.annotations.Test;

package net.jodah.sarge.functional;



/**
 * @author Jonathan Halterman
 */
@Test
public class SupervisorOverride extends AbstractTest {
  private static final Plan RETHROW_STRATEGY = new Plan() {