expect(reference2.getType()).andReturn(String.class);
expect(selected1.getType()).andReturn(String.class);
expect(reference1.getReferenceContext()).andReturn(context);
expect(reference2.getReferenceContext()).andReturn(context);
expect(reference1.selectAttribute(propertyName)).andReturn(selected1);
expect(reference2.selectAttribute(propertyName)).andThrow(new BindingException("No property pi"));
selected1.document(document);
expect(selected1.getReferenceContext()).andReturn(context);
replay(reference1, reference2, selected1, selected2);
MultiReference multi = new MultiReference(reference1, reference2);
Reference selected = multi.selectAttribute(propertyName);