android rxjava sort list with comparator class : <p>I started to use rxjava with my android projects. I need to sort returning event list from api call. I wrote comparator class to sort list :</p>

<pre><code>public class EventParticipantComparator {

    public static class StatusComparator implements Comparator&lt;EventParticipant&gt; {

        @Override
        public int compare(EventParticipant participant1, EventParticipant participant2) {
            return participant1.getStatus() - participant2.getStatus();
        }
    }
}
</code></pre>

<p>I can use this class with classic Collections class.</p>

<pre><code>Collections.sort(participants, new EventParticipantComparator.StatusComparator());
</code></pre>

<p>how can I achieve this situation with reactive way ? <strong>also if there are any way to sort list asynchronously, I will prefer that way.</strong></p>

<p>Reactive way without sorting list :</p>

<pre><code>dataManager.getEventImplementer().getParticipants(event.getId())
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new Subscriber&lt;List&lt;EventParticipant&gt;&gt;() {
                    @Override
                    public void onCompleted() {

                    }

                    @Override
                    public void onError(Throwable e) {

                    }

                    @Override
                    public void onNext(List&lt;EventParticipant&gt; eventParticipants) {

                    }
                });
</code></pre>
