PlanStabilityVerifier { public void recordPlanSignature(Mutable<ILogicalOperator> opRef) throws AlgebricksException { reset(); walk(opRef, recorderVisitor); } PlanStabilityVerifier(IPlanPrettyPrinter prettyPrinter); void recordPlanSignature(Mutable<ILogicalOperator> opRef); void comparePlanSignature(Mutable<ILogicalOperator> opRef); void discardPlanSignature();  }
@Test public void testCycleBeforeRecord() { AssignOperator op1 = newAssign(newVar(), newMutable(ConstantExpression.TRUE)); Mutable<ILogicalOperator> opRef1 = newMutable(op1); AssignOperator op2 = newAssign(newVar(), newMutable(ConstantExpression.FALSE)); Mutable<ILogicalOperator> opRef2 = newMutable(op2); op1.getInputs().add(opRef2); op2.getInputs().add(opRef1); try { verifier.recordPlanSignature(opRef1); } catch (AlgebricksException e) { Assert.assertTrue(e.getMessage(), e.getMessage().contains("cycle")); } }