public static < T > Observable . Transformer < T , ImmutableList < T > > toImmutableList ( ) { return new Observable . Transformer < T , ImmutableList < T > > ( ) { @ Override public Observable < ImmutableList < T > > call ( Observable < T > source ) { return source . collect ( new Func0 < ImmutableList . Builder < T > > ( ) { @ Override public ImmutableList . Builder < T > call ( ) { return ImmutableList . builder ( ) ; } } , new Action2 < ImmutableList . Builder < T > , T > ( ) { @ Override public void call ( ImmutableList . Builder < T > builder , T t ) { builder . add ( t ) ; } } ) . map ( new Func1 < ImmutableList . Builder < T > , ImmutableList < T > > ( ) { @ Override public ImmutableList < T > call ( ImmutableList . Builder < T > builder ) { return builder . build ( ) ; } } ) ; } } ; }
Returns a Transformer&lt ; T ImmutableList&lt ; T&gt ; &gt that maps an Observable&lt ; T&gt ; to an Observable&lt ; ImmutableList&lt ; T&gt ; &gt ;