How do I assign variables from BlockBase object?
Via try and error, I found out, that declaring the variables-array in the function mytest_theme() makes it possible, to set the variable in the MytestBlock-Class:

Changes in mytest.module:

function mytest_theme() {
    return array('mytest_block' =&gt;
        array('variables' =&gt; array('test' =&gt; 'hello', 'test3' =&gt; null)));
}


Changes in MytestBlock.php:

class MytestBlock extends BlockBase implements BlockPluginInterface {
  public function build() {
    return array(
        '#theme' =&gt; 'mytest_block',
        '#test3' =&gt; 'hello3',
    );
  }
}


But I still have no idea how to access the Block-Plugin Instance in mytest.module.