/**
  * Set product options data
  *
  * @param OrderItemInterface $orderItem
  * @param array $data
  * @return $this
  */
 protected function setProductOption(OrderItemInterface $orderItem, array $data)
 {
     $productOption = $orderItem->getProductOption();
     if (!$productOption) {
         $productOption = $this->productOptionFactory->create();
         $orderItem->setProductOption($productOption);
     }
     $extensionAttributes = $productOption->getExtensionAttributes();
     if (!$extensionAttributes) {
         $extensionAttributes = $this->extensionFactory->create();
         $productOption->setExtensionAttributes($extensionAttributes);
     }
     $extensionAttributes->setData(key($data), current($data));
     return $this;
 }
 protected function getProductOptionExtensionMock()
 {
     $productOptionExtension = $this->getMockBuilder('Magento\\Catalog\\Api\\Data\\ProductOptionExtensionInterface')->setMethods(['setData'])->getMockForAbstractClass();
     $productOptionExtension->expects($this->any())->method('setData')->with(key($this->productOptionData), current($this->productOptionData))->willReturnSelf();
     $this->extensionFactory->expects($this->any())->method('create')->willReturn($productOptionExtension);
 }