1
|
|
package com.adventofcode.day16 |
2
|
|
|
3
|
|
typealias Field = Int |
4
|
|
|
5
|
|
class Ticket(internal vararg val fields: Field) { |
6
|
|
|
7
|
|
fun findErrorsAccordingTo(validRanges: Collection<ValidRanges>): Collection<Field> { |
8
|
1
1. findErrorsAccordingTo : replaced return value with Collections.emptyList for com/adventofcode/day16/Ticket::findErrorsAccordingTo → KILLED
|
return listOf(fields.firstOrNull { field -> |
9
|
3
1. findErrorsAccordingTo : Changed increment from 1 to -1 → KILLED
2. findErrorsAccordingTo : negated conditional → KILLED
3. findErrorsAccordingTo : negated conditional → KILLED
|
!validRanges.any { it.accept(field) } |
10
|
1
1. findErrorsAccordingTo : replaced return value with Collections.emptyList for com/adventofcode/day16/Ticket::findErrorsAccordingTo → SURVIVED
|
} ?: return emptyList()) |
11
|
|
} |
12
|
|
|
13
|
|
fun findValidAccordingTo(validRanges: Collection<ValidRanges>): Map<Int, List<String>> { |
14
|
|
return fields |
15
|
|
.mapIndexed() { index, field -> |
16
|
|
index to validRanges |
17
|
1
1. findValidAccordingTo : negated conditional → KILLED
|
.filter { it.accept(field) } |
18
|
|
} |
19
|
|
.map { it.first to it.second.map { it.name }.toList() } |
20
|
|
.toMap() |
21
|
|
} |
22
|
|
} |
| | Mutations |
8 |
|
1.1 Location : findErrorsAccordingTo Killed by : com.adventofcode.day16.TicketTest.[engine:junit-jupiter]/[class:com.adventofcode.day16.TicketTest]/[method:shouldFindErrorsAccordingToValidRange()] replaced return value with Collections.emptyList for com/adventofcode/day16/Ticket::findErrorsAccordingTo → KILLED
|
9 |
|
1.1 Location : findErrorsAccordingTo Killed by : com.adventofcode.day16.TicketTest.[engine:junit-jupiter]/[class:com.adventofcode.day16.TicketTest]/[method:shouldFindErrorsAccordingToValidRange()] Changed increment from 1 to -1 → KILLED 2.2 Location : findErrorsAccordingTo Killed by : com.adventofcode.day16.TicketTest.[engine:junit-jupiter]/[class:com.adventofcode.day16.TicketTest]/[method:shouldFindErrorsAccordingToValidRange()] negated conditional → KILLED 3.3 Location : findErrorsAccordingTo Killed by : com.adventofcode.day16.TicketTest.[engine:junit-jupiter]/[class:com.adventofcode.day16.TicketTest]/[method:shouldFindErrorsAccordingToValidRange()] negated conditional → KILLED
|
10 |
|
1.1 Location : findErrorsAccordingTo Killed by : none replaced return value with Collections.emptyList for com/adventofcode/day16/Ticket::findErrorsAccordingTo → SURVIVED
|
17 |
|
1.1 Location : findValidAccordingTo Killed by : com.adventofcode.day16.TicketTest.[engine:junit-jupiter]/[class:com.adventofcode.day16.TicketTest]/[method:shouldFFindValidOnesAccordingToValidRange()] negated conditional → KILLED
|
24 |
|
1.1 Location : findErrorsAccordingTo Killed by : com.adventofcode.day16.TicketTest.[engine:junit-jupiter]/[class:com.adventofcode.day16.TicketTest]/[method:shouldFindErrorsAccordingToValidRange()] changed conditional boundary → KILLED 2.2 Location : findErrorsAccordingTo Killed by : com.adventofcode.day16.TicketTest.[engine:junit-jupiter]/[class:com.adventofcode.day16.TicketTest]/[method:shouldFindErrorsAccordingToValidRange()] negated conditional → KILLED
|
25 |
|
1.1 Location : findErrorsAccordingTo Killed by : com.adventofcode.day16.TicketTest.[engine:junit-jupiter]/[class:com.adventofcode.day16.TicketTest]/[method:shouldFindErrorsAccordingToValidRange()] negated conditional → KILLED
|
26 |
|
1.1 Location : findErrorsAccordingTo Killed by : com.adventofcode.day16.TicketTest.[engine:junit-jupiter]/[class:com.adventofcode.day16.TicketTest]/[method:shouldFindErrorsAccordingToValidRange()] negated conditional → KILLED
|
27 |
|
1.1 Location : findErrorsAccordingTo Killed by : com.adventofcode.day16.TicketTest.[engine:junit-jupiter]/[class:com.adventofcode.day16.TicketTest]/[method:shouldFindErrorsAccordingToValidRange()] negated conditional → KILLED
|
28 |
|
1.1 Location : findErrorsAccordingTo Killed by : com.adventofcode.day16.TicketTest.[engine:junit-jupiter]/[class:com.adventofcode.day16.TicketTest]/[method:shouldFindErrorsAccordingToValidRange()] negated conditional → KILLED
|
32 |
|
1.1 Location : findValidAccordingTo Killed by : com.adventofcode.day16.TicketTest.[engine:junit-jupiter]/[class:com.adventofcode.day16.TicketTest]/[method:shouldFFindValidOnesAccordingToValidRange()] Changed increment from 1 to -1 → KILLED
|