droppedContainers.add(null);
}
// Handle the case of a bond between mergedAtom and mergedPartnerAtom.
// This bond should be removed.
IBond rb = container1.getBond(mergedAtom, mergedPartnerAtom);
if (rb != null) {
container1.removeBond(rb);
removedBonds.add(rb);
}
// In the next loop we remove bonds that are redundant, that is
// to say bonds that exist on both sides of the parts to be merged
// and would cause duplicate bonding in the end result.
for (IAtom atom : container1.atoms()) {
if (!atom.equals(mergedAtom)) {
if (container1.getBond(mergedAtom, atom) != null) {
if (model.getMerge().containsKey(atom)) {
for (IAtom atom2 : container2.atoms()) {
if (!atom2.equals(mergedPartnerAtom)) {
if (container1.getBond(mergedPartnerAtom,
atom2) != null) {
if (model.getMerge().get(atom).equals(
atom2)) {
IBond redundantBond = container1
.getBond(atom, mergedAtom);
container1
.removeBond(redundantBond);
removedBonds.add(redundantBond);
}