LogoutHandler { public void clearData(Func0 callback) { realm.executeTransactionAsync(r -> r.deleteAll(), callback::apply); } @Inject  LogoutHandler(Realm realm); void clearData(Func0 callback);  }
@Test public void shouldClearAllDataOnDevice() throws Exception { final int[] count = {0}; mTarget.clearData(() -> count[0] = 1); assertThat(count[0]).isEqualTo(1); }