MemberLookupExpr extends Expr { @Override public MemberLookupExpr clone() { return new MemberLookupExpr(structure.clone(), member); } MemberLookupExpr(Expr structure, String member); Expr getStructure(); void setStructure(Expr structure); String getMember(); void setMember(String member); @Override void accept(IAstVisitor visitor); @Override MemberLookupExpr clone(); @Override boolean hasChild(IAstNode candidateChild); @Override Expr getChild(int index); @Override void setChild(int index, Expr expr); @Override int getNumChildren();  }
@Test public void testClone() throws Exception { VariableIdentifierExpr v = new VariableIdentifierExpr("v"); MemberLookupExpr mle = new MemberLookupExpr( v, "foo"); MemberLookupExpr mle2 = mle.clone(); assertFalse(mle == mle2); assertEquals(mle.getMember(), mle2.getMember()); assertEquals(((VariableIdentifierExpr) mle.getStructure()).getName(), ((VariableIdentifierExpr) mle2.getStructure()).getName()); assertFalse(mle.getStructure() == mle2.getStructure()); }