Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
.filter { task -> task.createdInTheLastTwoDays() && task.isCompleted() }
.forEach { task -> println(task.description) }
//extracted code:
class Task(
val id: Int,
val description: String,
val status: Status,
val createdAt: LocalDateTime
) {
fun isCompleted(): Boolean {
return status == Resolved
|| status == Cancelled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment