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