/**
   * {@inheritDoc}
   *
   * @see
   *     org.eclipse.emf.compare.uml2.diff.internal.extension.IDiffExtensionFactory#create(org.eclipse.emf.compare.diff.metamodel.DiffElement,
   *     org.eclipse.emf.ecore.util.EcoreUtil.CrossReferencer)
   */
  public AbstractDiffExtension create(
      DiffElement input, EcoreUtil.CrossReferencer crossReferencer) {
    final ModelElementChangeLeftTarget changeLeftTarget = (ModelElementChangeLeftTarget) input;
    final Message message = (Message) changeLeftTarget.getLeftElement();

    final UMLMessageChangeLeftTarget ret =
        UML2DiffFactory.eINSTANCE.createUMLMessageChangeLeftTarget();

    final MessageEnd receiveEvent = message.getReceiveEvent();
    if (receiveEvent != null) {
      hideEvent(receiveEvent, ret, crossReferencer);
    }

    final MessageEnd sendEvent = message.getSendEvent();
    if (sendEvent != null) {
      hideEvent(sendEvent, ret, crossReferencer);
    }

    ret.getHideElements().add(changeLeftTarget);
    ret.getRequires().add(changeLeftTarget);

    ret.setRemote(changeLeftTarget.isRemote());
    ret.setRightParent(changeLeftTarget.getRightParent());
    ret.setLeftElement(changeLeftTarget.getLeftElement());

    return ret;
  }
 public static boolean canReorientSource(Message message, Element newSource) {
   if (message == null || newSource == null) {
     return false;
   }
   Element target = null;
   MessageEnd receiveEvent = message.getReceiveEvent();
   if (receiveEvent instanceof OccurrenceSpecification) {
     EList<Lifeline> covereds = ((OccurrenceSpecification) receiveEvent).getCovereds();
     if (!covereds.isEmpty()) {
       target = covereds.get(0);
     }
   } else if (receiveEvent instanceof Gate
       // special handling of SyncMessages due to #425666
       && MessageSort.SYNCH_CALL_LITERAL != message.getMessageSort()) {
     target = ((Gate) receiveEvent).getOwner();
   }
   return canExist(message, newSource, target);
 }