@Test public void testClone() { TypeConstructorExpr tce = new TypeConstructorExpr( "hey", Arrays.asList(new VariableIdentifierExpr("x"), new VariableIdentifierExpr("y"))); TypeConstructorExpr tce2 = tce.clone(); assertFalse(tce == tce2); assertEquals(tce.getTypename(), tce2.getTypename()); assertFalse(tce.getArg(0) == tce2.getArg(0)); assertFalse(tce.getArg(1) == tce2.getArg(1)); assertEquals(((VariableIdentifierExpr) tce.getArg(0)).getName(), ((VariableIdentifierExpr) tce2.getArg(0)).getName()); assertEquals(((VariableIdentifierExpr) tce.getArg(1)).getName(), ((VariableIdentifierExpr) tce2.getArg(1)).getName()); }
@Override public TypeConstructorExpr clone() { return new TypeConstructorExpr(type, args.stream().map(x -> x.clone()).collect(Collectors.toList())); }
TypeConstructorExpr extends Expr { @Override public TypeConstructorExpr clone() { return new TypeConstructorExpr(type, args.stream().map(x -> x.clone()).collect(Collectors.toList())); } }
TypeConstructorExpr extends Expr { @Override public TypeConstructorExpr clone() { return new TypeConstructorExpr(type, args.stream().map(x -> x.clone()).collect(Collectors.toList())); } TypeConstructorExpr(String type, List<Expr> args);  TypeConstructorExpr(String type, Expr... params); }
TypeConstructorExpr extends Expr { @Override public TypeConstructorExpr clone() { return new TypeConstructorExpr(type, args.stream().map(x -> x.clone()).collect(Collectors.toList())); } TypeConstructorExpr(String type, List<Expr> args);  TypeConstructorExpr(String type, Expr... params); String getTypename(); void setTypename(String type); List<Expr> getArgs(); Expr getArg(int index); Expr removeArg(int index); int getNumArgs(); @Override void accept(IAstVisitor visitor); @Override TypeConstructorExpr clone(); void insertArg(int index, Expr arg); @Override boolean hasChild(IAstNode candidateChild); @Override Expr getChild(int index); @Override void setChild(int index, Expr expr); @Override int getNumChildren(); }
TypeConstructorExpr extends Expr { @Override public TypeConstructorExpr clone() { return new TypeConstructorExpr(type, args.stream().map(x -> x.clone()).collect(Collectors.toList())); } TypeConstructorExpr(String type, List<Expr> args);  TypeConstructorExpr(String type, Expr... params); String getTypename(); void setTypename(String type); List<Expr> getArgs(); Expr getArg(int index); Expr removeArg(int index); int getNumArgs(); @Override void accept(IAstVisitor visitor); @Override TypeConstructorExpr clone(); void insertArg(int index, Expr arg); @Override boolean hasChild(IAstNode candidateChild); @Override Expr getChild(int index); @Override void setChild(int index, Expr expr); @Override int getNumChildren();  }