TypeConstructorExpr extends Expr { @Override public Expr getChild(int index) { if (index < 0 || index >= args.size()) { throw new IndexOutOfBoundsException("TypeConstructorExpr has no child at index " + index); } return args.get(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(expected = IndexOutOfBoundsException.class) public void getChildBad() { TypeConstructorExpr tce = new TypeConstructorExpr("hi", new IntConstantExpr("5")); tce.getChild(1); }