Source:
<code>protected void addInTarget(ResourceAttachmentChange diff, boolean rightToLeft) { final Match match = diff.getMatch(); final Comparison comparison = match.getComparison(); final Resource expectedContainer = findOrCreateTargetResource(match, rightToLeft); if (expectedContainer == null) { diff.setState(DifferenceState.UNRESOLVED); return; } final EObject sourceValue; if (rightToLeft) { sourceValue = match.getRight(); } else { sourceValue = match.getLeft(); } final EObject expectedValue; if (rightToLeft) { if (match.getLeft() != null) { expectedValue = match.getLeft(); } else { <START> mergeRelatedContainmentRefChanges(diff, sourceValue, rightToLeft); <END> EObject leftValue = match.getLeft(); if (leftValue == null) { expectedValue = createCopy(sourceValue); match.setLeft(expectedValue); } else { expectedValue = leftValue; } } } else if (match.getRight() != null) { expectedValue = match.getRight(); } else { mergeRelatedContainmentRefChanges(diff, sourceValue, rightToLeft); EObject rightValue = match.getRight(); if (rightValue == null) { expectedValue = createCopy(sourceValue); match.setRight(expectedValue); } else { expectedValue = rightValue; } } final Resource initialResource = sourceValue.eResource(); final List<EObject> sourceList = initialResource.getContents(); final List<EObject> targetList = expectedContainer.getContents(); final int insertionIndex = findInsertionIndex(comparison, sourceList, targetList, expectedValue); addAt(targetList, expectedValue, insertionIndex); if (initialResource instanceof XMIResource && expectedContainer instanceof XMIResource) { ((XMIResource)expectedContainer).setID(expectedValue, ((XMIResource)initialResource) .getID(sourceValue)); } }</code><technical_language>This handle setting relevant implications diffs beforehand, standard merge mechanism work properly</technical_language>

Target:
protected void addInTarget(ResourceAttachmentChange diff, boolean rightToLeft) { final Match match = diff.getMatch(); final Comparison comparison = match.getComparison(); final Resource expectedContainer = findOrCreateTargetResource(match, rightToLeft); if (expectedContainer == null) { diff.setState(DifferenceState.UNRESOLVED); return; } final EObject sourceValue; if (rightToLeft) { sourceValue = match.getRight(); } else { sourceValue = match.getLeft(); } final EObject expectedValue; if (rightToLeft) { if (match.getLeft() != null) { expectedValue = match.getLeft(); } else { expectedValue = createCopy(sourceValue); match.setLeft(expectedValue); } } else if (match.getRight() != null) { expectedValue = match.getRight(); } else { expectedValue = createCopy(sourceValue); match.setRight(expectedValue); } final Resource initialResource = sourceValue.eResource(); final List<EObject> sourceList = initialResource.getContents(); final List<EObject> targetList = expectedContainer.getContents(); final int insertionIndex = findInsertionIndex(comparison, sourceList, targetList, expectedValue); addAt(targetList, expectedValue, insertionIndex); if (initialResource instanceof XMIResource && expectedContainer instanceof XMIResource) { ((XMIResource)expectedContainer).setID(expectedValue, ((XMIResource)initialResource) .getID(sourceValue)); } }