val items = listOf(1, 2, 3, 4, 5) // actual sum of 15 이와 같은 collection에서 전체 합을 구해보기. 1. foreach @Test fun sumTest_1() { var total = 0 items.forEach { total += it } Assert.assertEquals(total, actual) } /** * Performs the given [action] on each element. */ @kotlin.internal.HidesMembers public inline fun Iterable.forEach(action: (T) -> Unit): Unit { for (element in this) action(element) } 가장 무난하게 많..