Renamed stream to duplex stream and added stream factory test for it