AbstractFlattrCallable implements FlattrCallable<R> { public void setFullMode(boolean full) { this.full = full; }  @Override void setAccessToken(AccessToken token); @Override void setAccessToken(String token); RateLimit getRateLimit(); void setFullMode(boolean full); boolean isFullMode(); abstract R call(FlattrService service); @Override R call(); @Override R getResult();  }
@Test public void testSetFullMode() throws Exception { final FlattrService mockService = mock(FlattrService.class); when(mockService.getLastRateLimit()).thenReturn(new RateLimit()); final AbstractFlattrCallable<String> callable = new AbstractFlattrCallable<String>() { @Override protected FlattrService createFlattrService(AccessToken token) { return mockService; } @Override public String call(FlattrService service) throws Exception { return null; } }; assertThat(callable.isFullMode(), is(false)); callable.call(); verify(mockService, times(1)).setFullMode(false); callable.setFullMode(true); assertThat(callable.isFullMode(), is(true)); callable.call(); verify(mockService, times(1)).setFullMode(true); callable.setFullMode(false); assertThat(callable.isFullMode(), is(false)); callable.call(); verify(mockService, times(2)).setFullMode(false); }