code: public static ResultSet combineResultSets(ResultSet first, ResultSet second) {
      Function<ColumnType, String> columnTypeToString = new Function<ColumnType, String>() {
        public String apply(ColumnType input) {
          return input.getLabelName();
        }
      };
      List<String> firstColumns =
          Lists.transform(Lists.newArrayList(first.getColumnTypes()), columnTypeToString);
      List<String> secondColumns =
          Lists.transform(Lists.newArrayList(second.getColumnTypes()), columnTypeToString);
      if (!firstColumns.equals(secondColumns)) {
        throw new IllegalArgumentException(String.format(
            "First result set columns [%s] do not match second columns [%s]",
            Joiner.on(",").join(firstColumns), Joiner.on(",").join(secondColumns)));
      }
      List<Row> combinedRows = Lists.newArrayList(first.getRows());
      if (second.getRows() != null) {
        combinedRows.addAll(Lists.newArrayList(second.getRows()));
      }
  
      ResultSet combinedResultSet = new ResultSet();
      combinedResultSet.getColumnTypes().addAll(first.getColumnTypes());
      combinedResultSet.getRows().addAll(combinedRows);
      return combinedResultSet;
    }
docs: Combines the first and second result sets, if and only if, the columns
  of both result sets match.
  
  @throws IllegalArgumentException if the columns of the first result set
  don't match the second