Q:

Consolidate/flatten nested lists in Android with RXJava2

I'm struggling to come up with an RXJava2 Solution to "a simple problem".  I am not extremely experienced with RXJava beyond the simple use cases. 
Suppose I have a Container that looks like:
class Container {
   List<A> listOfA;
}

The rest of the model is a series of nested lists like this model:
class Base {
   // irrelevant content
}

class A extends Base {
   List<B> listOfB;
}

class B extends Base {
   // irrelevant content
}

Somewhere in my code, I obtain a Single<Container> like so:
(note: the code/types/etc have been obfuscated/simplified for an easier reading)
disposables = new CompositeDisposable(); // not important here

disposables.add(
    interactor.getTheContainer() // This returns a Single<Container>
        .subscribeOn(Schedulers.io())
        .observeOn(AndroidSchedulers.mainThread())
        .subscribeWith(new DisposableSingleObserver<Container>() {

            // on error ommited for clarity

            @Override
            public void onSuccess(final Container value) {
               process(value);
            }
        })
    );

private void process(final Container container) {
    List<Base> items = new ArrayList<>();

    List<A> listOfA = container.getListOfA();

    for (A a : listOfA) {
        items.add(a);
        items.addAll(a.getListOfB());
    }

    // do something with "items" - ommited for clarity
}

I have been unsuccessfully trying to convert the method process(Container) to RXJava (maybe I shouldn't but now I want to know).  
I can't even begin to list all the stuff I've experimented with, but I'm really new to RXJava 2 (most usages I've done in the past years with RX were simple Observables from Retrofit and nothing too fancy, or even as an Event Bus to replace Otto/Guava), so I am really not well versed in the arts of making good usage of the RX toolset.  I think some sort of map should work, but the whole Java syntax gets confusing really fast for me when it comes to anonymous methods.  
The question is: 
Where should I read/look for ideas how to perform the same operation of the process method but with RXJava2?  
Order is important, the final list looks like this with the current method and I need it this way: 
0.  A1
1.  B1.1
2.  B1.2
3.  B1.nn…
4.  A2
5.  B2.1
6.  B2.2
7.  B2.nn…
8.  A3
9.  B3.1
…

You get the idea.  
Any hints?  I do not have Retrolambda or Java 8 (nor can use it, it's not my decision and I can't do anything about it). 

A:

You were almost there:
List<Base> process(List<A> list) {
    List<Base> result = new ArrayList<>();
    for (A a : list) {
        result.add(a);
        result.addAll(a.getListOfB());
    }
    return result;
}

interactor.getTheContainer() // This returns a Single<Container>
    .subscribeOn(Schedulers.io())
    .map(new Function<Container, List<Base>>() {
        @Override public List<Base> apply(Container c) {
             return process(c.getListOfA());
        }
    })
    .observeOn(AndroidSchedulers.mainThread())
    .subscribeWith(new DisposableSingleObserver<List<Base>>() {
        @Override public void onSuccess(final List<Base> value) {
           /* display the list */
        }
    })

A more "convoluted" solution could replace the map above with some Iterable transformation via IxJava:
.flatMapIterable(new Function<Container, Iterable<A>>() {
    @Override public Iterable<A> apply(Container c) {
        return c.getListOfA();
    }
})
.flatMapIterable(new Function<Iterable<A>, Iterable<Base>>() {
    @Override public Iterable<Base> apply(Iterable<A> a) {
        return Ix.<Base>just(a).concatWith(a.getListOfB());
    }
})
.toList()

