@Test
public void inverseNightMode() throws Exception {

    TextAppearance textAppearance = mock(TextAppearance.class);
    when(textAppearance.isNightMode()).thenReturn(false);
    when(preferenceHelper.getTextAppearance()).thenReturn(textAppearance);
    doAnswer(invocation -> {
        when(textAppearance.isNightMode()).thenReturn(invocation.getArgument(0));
        return null;
    }).when(preferenceHelper).setNightMode(anyBoolean());
    presenter.inverseNightMode();
    ArgumentCaptor<TextAppearance> captor = ArgumentCaptor.forClass(TextAppearance.class);
    verify(view).setTextAppearance(captor.capture());
    assertTrue(captor.getValue().isNightMode());
}