How to use Model (i.e. $this->loadModel();) in our own Library

Below is the sample tested working in Cakephp3.2,

Class XYZ {
use \Cake\ORM\Locator\LocatorAwareTrait;
use \Cake\Datasource\ModelAwareTrait;

public function __construct() {
$this->modelFactory(‘Table’, [$this->tableLocator(), ‘get’]);
}

public function someMethod() {
$this->loadModel(‘Users’);
pr($this->Users->get(1));
}