protected function close()
    {
        if ($this->current_lot !== null) {
            $this->registry_count++;
            $this->current_lot += 2;
            $this->registries[] = $this->generateLotTrailer();
            $this->current_lot = null;
        }

        $this->registry_count++;
        $this->registries[] = $this->generateFileTrailer();
    }