PlanStabilityVerifier { public void comparePlanSignature(Mutable<ILogicalOperator> opRef) throws AlgebricksException { if (opRefColl.isEmpty()) { throw new IllegalStateException(); } try { walk(opRef, verifierVisitor); ensureEmpty(opRefColl, MSG_DELETED, MSG_OPERATOR_REFERENCE, PlanStabilityVerifier::printOperator); ensureEmpty(opColl, MSG_DELETED, MSG_OPERATOR_INSTANCE, PlanStabilityVerifier::printOperator); ensureEmpty(exprRefColl, MSG_DELETED, MSG_EXPRESSION_REFERENCE, PlanStabilityVerifier::printExpression); ensureEmpty(exprColl, MSG_DELETED, MSG_EXPRESSION_INSTANCE, PlanStabilityVerifier::printExpression); } finally { reset(); } } PlanStabilityVerifier(IPlanPrettyPrinter prettyPrinter); void recordPlanSignature(Mutable<ILogicalOperator> opRef); void comparePlanSignature(Mutable<ILogicalOperator> opRef); void discardPlanSignature();  }
@Test public void testApiCompareWithoutRecordFailure() throws Exception { AssignOperator op = newAssign(newVar(), newMutable(newVarRef(newVar()))); Mutable<ILogicalOperator> opRef = newMutable(op); try { verifier.comparePlanSignature(opRef); Assert.fail("Expected to catch " + IllegalStateException.class.getName()); } catch (IllegalStateException e) { } }