### Question:
ComputableLiveData { public LiveData<T> getLiveData() {return null;} ComputableLiveData(); LiveData<T> getLiveData(); void invalidate();  }### Answer:
@Test public void addingObserverShouldTriggerAComputation() { TestComputable computable = new TestComputable(1); mLifecycleOwner.handleEvent(Lifecycle.Event.ON_CREATE); final AtomicInteger mValue = new AtomicInteger(-1); computable.getLiveData().observe(mLifecycleOwner, new Observer<Integer>() { @Override public void onChanged(@Nullable Integer integer) { mValue.set(integer); } }); verify(mTaskExecutor, never()).executeOnDiskIO(any(Runnable.class)); assertThat(mValue.get(), is(-1)); mLifecycleOwner.handleEvent(Lifecycle.Event.ON_START); verify(mTaskExecutor).executeOnDiskIO(computable.mRefreshRunnable); assertThat(mValue.get(), is(1)); }