Tutorial: Kotlin Collections/Sequences Vs Java Streams (List processing in Style!)
Channel: Kyle Luce
Date: 2019-12-08

Hi Fellow Devs,


Are you a Java Developer who would like to check out Kotlin?  Are you tired of Java's old style boiler plate work?


This video is for you!


In this video I'll show how to:


- Use Kotlin Collections in a similar way to Streams in Java
- What the advantages and disadvantages of each are
- And ultimately how to use Sequences to make your Kotlin code efficient

Tools used:


 - Intellij IDEA 2019.2
- Java Streams
- Kotlin Collections Extension functions: map, filter, flatmap, filterNotNull, any
- Kotlin Test framework


Github code: 




Java Streams Example:
   https://github.com/Razzlegames/KotlinTraining/blob/KotlinCollectionsVideo/src/main/java/kotlintraining/lesson2/streams/StreamConversion.java#L52-L65




Kotlin Equivalent using Sequences:
   https://github.com/Razzlegames/KotlinTraining/blob/KotlinCollectionsVideo/src/main/java/kotlintraining/lesson2/streams/KotlinCollectionsExample.kt


Kotlin Unit test:
   https://github.com/Razzlegames/KotlinTraining/blob/KotlinCollectionsVideo/src/test/java/kotlintraining/lesson2/streams/KotlinCollectionsExampleKtTest.kt