protected function prepareAttachment($mosaic)
    {
        if ($mosaic instanceof MosaicAttachment) {
            return $mosaic;
        }
        elseif ($mosaic instanceof MosaicAttachments) {
            return $mosaic->shift();
        }
        elseif ($mosaic instanceof Mosaic) {
            return new MosaicAttachment(["mosaicId" => $mosaic->toDTO()]);
        }
        elseif ($mosaic instanceof MosaicDefinition) {
            return new MosaicAttachment(["mosaicId" => $mosaic->id()->toDTO()]);
        }
        elseif (is_string($mosaic)) {
            return $this->prepareAttachment(Mosaic::create($mosaic));
        }

        throw new InvalidArgumentException("Unrecognized mosaic parameter type passed to \\NEM\\Models\\Transaction\\MosaicTransfer::attachMosaic().");
    }