Creates an entity of type $this->entity_type and bundle $this->bundle.
array $values: (optional) Additional values to pass to entity_create().
\Drupal\Core\Entity\EntityInterface The created entity object.
protected function createEntity($values = array()) {
$info = entity_get_info($this->entity_type);
$bundle_key = $info['entity_keys']['bundle'];
$entity = entity_create($this->entity_type, $values + array(
$bundle_key => $this->bundle,
));
return $entity;
}