@Test public void convertsFromAsyncPublisher() { Flowable<String> input = Flowable.just("foo") .concatWith(Flowable.just("bar", "baz").observeOn(sBackgroundScheduler)); LiveData<String> liveData = LiveDataReactiveStreams.fromPublisher(input); liveData.observe(mLifecycleOwner, mObserver); assertThat(mLiveDataOutput, is(Collections.singletonList("foo"))); sBackgroundScheduler.triggerActions(); assertThat(mLiveDataOutput, is(Arrays.asList("foo", "bar", "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);  }