public Observable < Product > getProduct ( int productId ) { return getAllProducts ( ) . flatMap ( products -> Observable . fromIterable ( products ) ) . filter ( product -> product . getId ( ) == productId ) . take ( 1 ) ; }
Get the product with the given id