docs: protected void mergeVariables(TaskQueryImpl extendedQuery, TaskQueryImpl extendingQuery) {
      List<TaskQueryVariableValue> extendingVariables = extendingQuery.getVariables();
  
      Set<TaskQueryVariableValueComparable> extendingVariablesComparable = new HashSet<TaskQueryVariableValueComparable>();
  
      // set extending variables and save names for comparison of original variables
      for (TaskQueryVariableValue extendingVariable : extendingVariables) {
        extendedQuery.addVariable(extendingVariable);
        extendingVariablesComparable.add(new TaskQueryVariableValueComparable(extendingVariable));
      }
  
      for (TaskQueryVariableValue originalVariable : this.getVariables()) {
        if (!extendingVariablesComparable.contains(new TaskQueryVariableValueComparable(originalVariable))) {
          extendedQuery.addVariable(originalVariable);
        }
      }
  
    }