In Magento 1 I can Inject a template through coding like below.
$layout = Mage::getSingleton('core/layout');
$block = $layout->createBlock('module/module_block_identifier');
$block->setTemplate('module/test.phtml');
In Magento 2, how can I inject a template like above?