here we merge two list and we sort the list for every new item added into . shall return 1 , 2 , 3 , 4 , 5 , 10 , 11 , 12 , 13 , 14 , 15 concode_field_sep PlaceHolder placeHolder concode_field_sep void testMerge concode_elem_sep void testMergeDelayError concode_elem_sep Observable<Person> obPerson concode_elem_sep Observable<Person> obPerson1 concode_elem_sep void showResult
void function ( ) { Observable . merge ( Observable . from ( Arrays . asList ( 2 , 1 , 13 , 11 , 5 ) ) , Observable . from ( Arrays . asList ( 10 , 4 , 12 , 3 , 14 , 15 ) ) ) . collect ( ArrayList < Integer > :: new , ArrayList :: add ) . doOnNext ( Collections :: sort ) . subscribe ( System . out :: println ) ; }