@Test public void convertsFromPublisherAfterInactive() { PublishProcessor<String> processor = PublishProcessor.create(); LiveData<String> liveData = LiveDataReactiveStreams.fromPublisher(processor); liveData.observe(mLifecycleOwner, mObserver); processor.onNext("foo"); liveData.removeObserver(mObserver); processor.onNext("bar"); liveData.observe(mLifecycleOwner, mObserver); processor.onNext("baz"); assertThat(mLiveDataOutput, is(Arrays.asList("foo", "foo", "baz"))); }
@NonNull public static <T> LiveData<T> fromPublisher(@NonNull Publisher<T> publisher) { return new PublisherLiveData<>(publisher); }
LiveDataReactiveStreams { @NonNull public static <T> LiveData<T> fromPublisher(@NonNull Publisher<T> publisher) { return new PublisherLiveData<>(publisher); } }
LiveDataReactiveStreams { @NonNull public static <T> LiveData<T> fromPublisher(@NonNull Publisher<T> publisher) { return new PublisherLiveData<>(publisher); } private  LiveDataReactiveStreams(); }
LiveDataReactiveStreams { @NonNull public static <T> LiveData<T> fromPublisher(@NonNull Publisher<T> publisher) { return new PublisherLiveData<>(publisher); } private  LiveDataReactiveStreams(); @NonNull static Publisher<T> toPublisher(
            @NonNull LifecycleOwner lifecycle, @NonNull LiveData<T> liveData); @NonNull static LiveData<T> fromPublisher(@NonNull Publisher<T> publisher); }
LiveDataReactiveStreams { @NonNull public static <T> LiveData<T> fromPublisher(@NonNull Publisher<T> publisher) { return new PublisherLiveData<>(publisher); } private  LiveDataReactiveStreams(); @NonNull static Publisher<T> toPublisher(
            @NonNull LifecycleOwner lifecycle, @NonNull LiveData<T> liveData); @NonNull static LiveData<T> fromPublisher(@NonNull Publisher<T> publisher);  }