ParenExpr extends Expr { @Override public Expr getChild(int index) { if (index == 0) { return expr; } throw new IndexOutOfBoundsException("Index for ParenExpr must be 0"); } ParenExpr(Expr expr); Expr getExpr(); @Override void accept(IAstVisitor visitor); @Override ParenExpr clone(); @Override boolean hasChild(IAstNode candidateChild); @Override Expr getChild(int index); @Override void setChild(int index, Expr expr); @Override int getNumChildren();  }
@Test public void getChild() { assertEquals(vie, pe.getChild(0)); }
@Test(expected = IndexOutOfBoundsException.class) public void getChildBad() { pe.getChild(1); }