Constant const2 = new Constant("b"); //$NON-NLS-1$
ArrayList thens = new ArrayList();
thens.add(const1);
thens.add(const2);
Expression elseExpression = new Constant("c"); //$NON-NLS-1$
CaseExpression expr = new CaseExpression(x, whens, thens);
expr.setElseExpression(elseExpression);
expr.setType(DataTypeManager.DefaultDataClasses.STRING);
CaseExpression clone = (CaseExpression)expr.clone();
assertTrue(expr != clone);
helpTestStrictEquivalence(x, clone.getExpression());
helpTestStrictEquivalence(expr.getExpression(), clone.getExpression());
assertEquals(2, clone.getWhenCount());
helpTestStrictEquivalence(e1, clone.getWhenExpression(0));
helpTestStrictEquivalence(expr.getWhenExpression(0), clone.getWhenExpression(0));
helpTestStrictEquivalence(e2, clone.getWhenExpression(1));
helpTestStrictEquivalence(expr.getWhenExpression(1), clone.getWhenExpression(1));
helpTestStrictEquivalence(const1, clone.getThenExpression(0));
helpTestStrictEquivalence(expr.getThenExpression(0), clone.getThenExpression(0));
helpTestStrictEquivalence(const2, clone.getThenExpression(1));
helpTestStrictEquivalence(expr.getThenExpression(1), clone.getThenExpression(1));
helpTestStrictEquivalence(expr.getElseExpression(), clone.getElseExpression());
assertEquals(expr.getType(), clone.getType());
assertEquals(expr.isResolved(), clone.isResolved());
}