Question: I have a block of code that transforms a block of List[VideoDetails] into a VideoGrid using a couple map statements with [ReactiveX](https://github.com/ReactiveX/RxJava):

```
feedService.loadVideoDetailsFeed(things)
            .map(new Func1<List<VideoDetails>, List<Video>>() {
                @Override
                public List<Video> call(List<VideoDetails> details) {
                    return Lists.transform(details, new Function<VideoDetails, Video>() {
                        @Override
                        public Video apply(VideoDetails input) {
                            return input.getVideo();
                        }
                    });
                }
            })
            .map(new Func1<List<Video>, VideoGrid>() {
                @Override
                public VideoGrid call(List<Video> videos) {
                    //stuff
                }
            })

```

As you can see, I'm using a Guava transform in one of the map statements to go from List[VideoDetails] to List[Video]. I would assume there is a better way through ReactiveX to accomplish this transformation? I was looking through the [transforming section](http://reactivex.io/documentation/operators.html#transforming) of the docs but I might be too green with ReactiveX to know what to use here.

The above code snippet works, I would just rather do it in the correct way if possible.

Answer: 
Keeping the rx style you can use example below : 

**edit**

```
feedService.loadVideoDetailsFeed(things)
        .flatMap(new Func1<List<VideoDetails>, Observable<Video>>() {
            @Override
            public Observable<Video> call(List<VideoDetails> videoDetailsList) {
                return Observable.from(videoDetailsList).map(new Func1<VideoDetails, Video>() {
                    @Override
                    public Video call(VideoDetails videoDetails) {
                        return videoDetails.getVideo();
                    }
                });
            }
        })
        .toList();

```
What you can do : 

* Starting with a `Observable<List<VideoDetails>>` then transform it to `Observable<VideoDetails>`.
* Transform this `Observable<VideoDetails>` to `Observable<Video>`.
* The last step : transform this `Observable<Video>` to `Observable<List<Video>>`.

This is very easy with RxJava (using the Java8 syntax)

```
feedService.loadVideoDetailsFeed(things) // Observable<List<VideoDetails>>
           .flapMap(Observable::from) // Observable<VideoDetails>
           .map(details -> details.getVideo()) // Observable<Video>
           .toList() // Observable<List<Video>>
           .map(/* doYourStuff */)
           .subscribe();

```