### Question:
TerminateVisitor implements SAXVisitBefore, SAXVisitAfter, Producer { @SuppressWarnings("WeakerAccess") @Inject public TerminateVisitor setTerminateBefore(Optional<Boolean> terminateBefore) { this.terminateBefore = terminateBefore.orElse(this.terminateBefore); return this; }  void visitBefore(SAXElement element, ExecutionContext executionContext); void visitAfter(SAXElement element, ExecutionContext executionContext); @SuppressWarnings("WeakerAccess") @Inject TerminateVisitor setTerminateBefore(Optional<Boolean> terminateBefore); @SuppressWarnings("unchecked") Set<?> getProducts();  }### Answer:
@Test public void test_terminate_prog_before() { Smooks smooks = new Smooks(); smooks.addVisitor(new TerminateVisitor().setTerminateBefore(Optional.of(true)), "customer"); smooks.addVisitor(new SAXVisitBeforeVisitor().setInjectedParam("blah"), "user"); smooks.filterSource(new StreamSource(getClass().getResourceAsStream("order.xml"))); assertFalse(SAXVisitBeforeVisitor.visited); }