Files
kotlin-fork/idea/testData/refactoring/introduceProperty/syntaxErrors.kt
T
2016-02-16 18:50:24 +03:00

8 lines
398 B
Kotlin
Vendored

// EXTRACTION_TARGET: property with getter
fun doSomethingStrangeWithCollection(collection: Collection<String>): Collection<String>? {
val groupsByLength = collection.groupBy { s -> { s.length } }
val maximumSizeOfGroup = groupsByLength.values.maxBy { it.size }.
return groupsByLength.values.firstOrNull { group -> {<selection>group.size == maximumSizeOfGroup</selection>} }
}