ArrayInfo implements IAstNode { @Override public ArrayInfo clone() { return new ArrayInfo(constantSize, sizeExpr.flatMap(item -> Optional.of(item.clone()))); } ArrayInfo(Expr originalSize); private  ArrayInfo(Optional<Integer> constantSize, Optional<Expr> originalSize);  ArrayInfo(); boolean hasConstantSize(); boolean hasSizeExpr(); Integer getConstantSize(); void setConstantSizeExpr(int foldedSize); Expr getSizeExpr(); void resetSizeExprToConstant(); @Override void accept(IAstVisitor visitor); @Override ArrayInfo clone();  }
@Test public void testClone() { final Expr sizeExpr = new IntConstantExpr("1"); final ArrayInfo arrayInfo1 = new ArrayInfo(sizeExpr); final ArrayInfo arrayInfo2 = arrayInfo1.clone(); assertNotSame(arrayInfo1, arrayInfo2); assertSame(sizeExpr, arrayInfo1.getSizeExpr()); assertNotSame(sizeExpr, arrayInfo2.getSizeExpr()); assertEquals(sizeExpr.getText(), arrayInfo2.getSizeExpr().getText()); }