Created
December 31, 2017 17:11
-
-
Save smallufo/29ae0e441de8fbe904507cbea786f1cb 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
interface IBookService { | |
fun findBooks(user: User, from: LocalDate, to: LocalDate): List<Tuple2<LocalDate, Book>> | |
fun findUserBooks(users: List<User>, from: LocalDate, to: LocalDate): List<Tuple3<LocalDate, User, Book>> { | |
return users.flatMap { user -> | |
findBooks(user , from , to).map { it -> Tuple3(it.v1 , user , it.v2) } | |
}.sortedBy { triple -> triple.v1 } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment