TypeConstructorExpr extends Expr { public Expr removeArg(int index) { return args.remove(index); } 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();  }
@Test public void removeArg() throws Exception { List<Expr> args = Arrays.asList(new BoolConstantExpr(true), new BoolConstantExpr(false), new IntConstantExpr("3"), new IntConstantExpr("4")); TypeConstructorExpr e = new TypeConstructorExpr("foo", args); assertEquals(4, args.size()); assertEquals(4, e.getArgs().size()); e.removeArg(1); assertEquals(4, args.size()); assertEquals(3, e.getArgs().size()); assertEquals(args.get(0), e.getArg(0)); assertEquals(args.get(2), e.getArg(1)); assertEquals(args.get(3), e.getArg(2)); }