### Question:
BufferedLiveEvent extends SingleLiveEvent<T> { @Override public void setValue(@Nullable T t) { if (hasActiveObservers() && mBuffer.isEmpty()) { super.setValue(t); } else { mBuffer.add(t); } }  @Override void postValue(@Nullable final T value); @Override void setValue(@Nullable T t);  }### Answer:
@Test public void startStopStart() { ble.setValue("a"); assertObserved(); lifecycle.handleLifecycleEvent(ON_START); assertObserved("a"); ble.setValue("b"); assertObserved("b"); ble.setValue("c"); lifecycle.handleLifecycleEvent(ON_STOP); ble.setValue("d"); ble.setValue("e"); assertObserved("c"); lifecycle.handleLifecycleEvent(ON_START); assertObserved("d", "e"); }
@Test public void nullValue() { lifecycle.handleLifecycleEvent(ON_START); ble.setValue("a"); ble.setValue(null); ble.setValue("b"); assertObserved("a", null, "b"); }
@Test public void observeRemoveObserve() { lifecycle.handleLifecycleEvent(ON_START); ble.setValue("a"); assertObserved("a"); ble.removeObserver(observer); ble.setValue("c"); ble.setValue("d"); assertObserved(); ble.observe(this, observer); assertObserved("c", "d"); }