The \Magento\Catalog\Model\Indexer\Product\AffectCache::beforeExecute() method can be simplified by returning void instead of it's arguments

https://github.com/magento/magento2/blob/c58d2d/app/code/Magento/Catalog/Model/Indexer/Product/AffectCache.php#L28-L38

This can be simplified to:

/**
 * @param \Magento\Framework\Indexer\ActionInterface $subject
 * @param array $ids
 * @return void
 * @SuppressWarnings(PHPMD.UnusedFormalParameter)
 */
public function beforeExecute(\Magento\Framework\Indexer\ActionInterface $subject, $ids)
{
	$this->context->registerEntities(\Magento\Catalog\Model\Product::CACHE_TAG, $ids);
}

A trick: a «before» plugin can return nothing if it needs not modify any argument

https://github.com/magento/magento2/issues/3363