public static function combineResultSets(
        ResultSet $first,
        ResultSet $second
    ) {
        $firstColumns = self::getColumnLabels($first);
        $secondColumns = self::getColumnLabels($second);

        if ($firstColumns !== $secondColumns) {
            throw new InvalidArgumentException(
                sprintf(
                    'First result set columns [%s] do not match second result '
                    . 'set columns [%s]',
                    implode(
                        ', ',
                        $firstColumns
                    ),
                    implode(', ', $secondColumns)
                )
            );
        }

        $combinedRows = $first->getRows();
        if (!empty($second->getRows())) {
            $combinedRows = array_merge($combinedRows, $second->getRows());
        }

        return new ResultSet($first->getColumnTypes(), $combinedRows);
    }