Kotlin, Kotest, Property Based Testing.
inputDto.positions ) ) } private fun mapInputPositionToOutputPosition(positions: List<InputPositionDto>): List<OutputPositionDto> { require(positions.isNotEmpty()) { "Positions must not be empty." } val sum = positions.fold(0.0) { acc, next -> acc + next.value } require(sum.compareTo(0.0) > -1) {