void replaceMember(RelationMember existing,RelationMember newMember){
  int idx;
  while ((idx=members.indexOf(existing)) != -1) {
    members.set(idx,newMember);
  }
}

void replaceMember ( RelationMember existing , RelationMember newMember ) { int idx ; while ( ( idx = members . indexOf ( existing ) ) != - 1 ) { members . set ( idx , newMember ) ; } }
replace an existing member in a relation with a different member .
