Created
February 26, 2018 14:51
-
-
Save rnaufal/8a7a47868921d6d8a268df92838ef73e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data class Employee(val name: String, val department: String) | |
val mark = Employee("Mark", "Accounting") | |
val john = Employee("John", "Management") | |
val smith = Employee("Smith", "Administrative") | |
val paul = Employee("Paul", "Accounting") | |
val employees = listOf(mark, john, smith, paul) | |
val employeesByDepartment = employees.groupBy { it.department } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment