private function getMappings(): Iterator
    {
        if ($this->mappings === null) {
            $filePaths = [];

            foreach ($this->mappingFilePaths as $mappingFilePath) {
                $newFilePaths = iterator_to_array(new SplFileObject($mappingFilePath, 'r'));
                $filePaths    = array_merge($filePaths, $newFilePaths);
            }

            $this->mappings = new ArrayIterator(
                array_map(
                    function (string $mapping) : FileMappingInterface {
                        return new UnixFileMapping(
                            $this->sourceDirectory,
                            $this->targetDirectory,
                            trim($mapping)
                        );
                    },
                    // Filter out empty lines.
                    array_filter(
                        $filePaths
                    )
                )
            );
        }

        return $this->mappings;
    }