Add test for stream functionality