code: private QueryResultImpl unionResults(QueryImpl query, Queue<QueryResultImpl> results, boolean distinct) {
          QueryResultImpl result = new QueryResultImpl(query);
  
          boolean ask = false;
  
          for (QueryResultImpl r : results) {
              if (r.ask()) {
                  ask = true;
              }
              r.getBindings().forEach(result::add);
          }
  
          result.setAsk(ask);
  
          if (distinct) {
              return eliminateDuplicates(result);
          }
          return result;
      }
docs: Union results
  
  @return the union result