Solution for streamToList