import io.vertx.core.json.JsonArray; import rx.Observable; import rx.Single; /** * @author abner2 */ public class RxPlayground { public static void main(String[] args) { JsonArray jsonArray = new JsonArray().add(1).add(2).add(3); // toList => See http://tomstechnicalblog.blogspot.com.br/2015/11/rxjava-operators-tolist.html Object b = Observable .from(jsonArray.getList().toArray()) .switchMap(x -> doSome((Integer) x).toObservable() ) .toList() .toSingle() ; ((Single) b).subscribe(System.out::println); System.out.println(b); // Here, using Buffer operator Object c = Observable .from(jsonArray.getList().toArray()) .switchMap(x -> doSome((Integer) x).toObservable() ) .buffer(jsonArray.size()) .toSingle() ; ((Single) c).subscribe(System.out::println); System.out.println(c); } public static Single doSome(Integer ind) { return Single.just(new Integer(ind + 1).toString()); } }