Mockito anyBoolean() matcher exception on return
<p>Trying to write a simple unit test with Mockito:</p>

<pre><code>@Test
    public void toggleBlockingControlTest_turnOff() {
        when(mainViewPresenter.getAppSettingsStorage().loadBlockingStatus())
                .thenReturn(Mockito.anyBoolean());

        AppSettingsStorage appSettingsStorage = mainViewPresenter.getAppSettingsStorage();
        boolean statusBefore = appSettingsStorage.loadBlockingStatus();

        Mockito.verify(appSettingsStorage).saveBlockingStatus(Mockito.eq(!statusBefore));
    }
</code></pre>

<p>In runtime i got org.mockito.exceptions.misusing.InvalidUseOfMatchersException: at this string:</p>

<pre><code>.thenReturn(Mockito.anyBoolean());
</code></pre>

<p>I am new to Mockito and can't understand why this framework cant return any boolean???</p>