code: private boolean isOnSameActivity(String lastActivityInstanceId, String lastActivityId,
                                     String currentActivityInstanceId, String currentActivityId) {
      return
        //activityInstanceId's can be null on transitions, so the activityId must be equal
        ((lastActivityInstanceId == null && lastActivityInstanceId == currentActivityInstanceId && lastActivityId.equals(currentActivityId))
          //if activityInstanceId's are not null they must be equal -> otherwise execution changed
          || (lastActivityInstanceId != null && lastActivityInstanceId.equals(currentActivityInstanceId)
          && (lastActivityId == null || lastActivityId.equals(currentActivityId))));
  
    }
docs: Compares the given activity instance id's and activity id's to check if the execution is on the same
  activity as before an operation was executed. The activity instance id's can be null on transitions.
  In this case the activity Id's have to be equal, otherwise the execution changed.
  
  @param lastActivityInstanceId    the last activity instance id
  @param lastActivityId            the last activity id
  @param currentActivityInstanceId the current activity instance id
  @param currentActivityId         the current activity id
  @return true if the execution is on the same activity, otherwise false