Source:
<code>private void internalCheckOrdering(ReferenceChange diff, boolean rightToLeft) { final EStructuralFeature feature = diff.getReference(); final EObject value = diff.getValue(); final Match match = diff.getMatch(); final Comparison comparison = match.getComparison(); final Match valueMatch = comparison.getMatch(value); final EObject sourceContainer; final EObject targetContainer; final EObject newValue; if (rightToLeft) { sourceContainer = match.getRight(); targetContainer = match.getLeft(); newValue = valueMatch.getLeft(); } else { sourceContainer = match.getLeft(); targetContainer = match.getRight(); newValue = valueMatch.getRight(); } final List<Object> sourceList = ReferenceUtil.getAsList(sourceContainer, feature); final List<Object> targetList = ReferenceUtil.getAsList(targetContainer, feature); final List<Object> lcs = DiffUtil.longestCommonSubsequence(comparison, sourceList, targetList); if (lcs.contains(valueMatch.getLeft()) || lcs.contains(valueMatch.getRight())) { return; } int insertionIndex = DiffUtil.findInsertionIndex(comparison, sourceList, targetList, value); if (insertionIndex >= 0) { @SuppressWarnings("unchecked") final List<EObject> changedList = (List<EObject>)safeEGet(targetContainer, feature); int size = changedList.size(); if (size > 1) { if (changedList instanceof EList<?>) { if (insertionIndex >= size) { ((EList<EObject>)changedList).move(size - 1, newValue); } else { ((EList<EObject>)changedList).move(insertionIndex, newValue); } } else { changedList.remove(newValue); <START> if (insertionIndex >= size) { <END> changedList.add(newValue); } else { changedList.add(insertionIndex, newValue); } } } } }</code><technical_language>in this case change ultimate behavior of this method (because ">" exact effect ">=" for result here), this is wanted write. Pay attention extracting new variables change behavior of code below. In this case, extracted "size()" call a call "remove()" changes result. Remember is necessary extract variables, especially more getters</technical_language>

Target:
private void internalCheckOrdering(ReferenceChange diff, boolean rightToLeft) { final EStructuralFeature feature = diff.getReference(); final EObject value = diff.getValue(); final Match match = diff.getMatch(); final Comparison comparison = match.getComparison(); final Match valueMatch = comparison.getMatch(value); final EObject sourceContainer; final EObject targetContainer; final EObject newValue; if (rightToLeft) { sourceContainer = match.getRight(); targetContainer = match.getLeft(); newValue = valueMatch.getLeft(); } else { sourceContainer = match.getLeft(); targetContainer = match.getRight(); newValue = valueMatch.getRight(); } final List<Object> sourceList = ReferenceUtil.getAsList(sourceContainer, feature); final List<Object> targetList = ReferenceUtil.getAsList(targetContainer, feature); final List<Object> lcs = DiffUtil.longestCommonSubsequence(comparison, sourceList, targetList); if (lcs.contains(valueMatch.getLeft()) || lcs.contains(valueMatch.getRight())) { return; } int insertionIndex = DiffUtil.findInsertionIndex(comparison, sourceList, targetList, value); if (insertionIndex >= 0) { @SuppressWarnings("unchecked") final List<EObject> changedList = (List<EObject>)safeEGet(targetContainer, feature); if (changedList.size() > 1) { if (changedList instanceof EList<?>) { if (insertionIndex > changedList.size()) { ((EList<EObject>)changedList).move(changedList.size() - 1, newValue); } else { ((EList<EObject>)changedList).move(insertionIndex, newValue); } } else { changedList.remove(newValue); if (insertionIndex > changedList.size()) { changedList.add(newValue); } else { changedList.add(insertionIndex, newValue); } } } } }