1
|
|
package net.bmahe.genetics4j.neat.combination.parentcompare; |
2
|
|
|
3
|
|
import java.util.Optional; |
4
|
|
import java.util.ServiceLoader; |
5
|
|
import java.util.ServiceLoader.Provider; |
6
|
|
|
7
|
|
import org.apache.commons.lang3.Validate; |
8
|
|
|
9
|
|
import net.bmahe.genetics4j.neat.spec.combination.parentcompare.ParentComparisonPolicy; |
10
|
|
|
11
|
|
public class ParentComparisonHandlerLocator { |
12
|
|
|
13
|
|
private final ServiceLoader<ParentComparisonHandler> parentComparisonHandlerServices; |
14
|
|
|
15
|
|
public ParentComparisonHandlerLocator() { |
16
|
|
|
17
|
2
1. <init> : removed call to java/util/ServiceLoader::load → KILLED
2. <init> : Removed assignment to member variable parentComparisonHandlerServices → KILLED
|
parentComparisonHandlerServices = ServiceLoader.load(ParentComparisonHandler.class); |
18
|
|
} |
19
|
|
|
20
|
|
public Optional<ParentComparisonHandler> find(final ParentComparisonPolicy parentComparisonPolicy) { |
21
|
|
Validate.notNull(parentComparisonPolicy); |
22
|
|
|
23
|
1
1. find : removed call to java/util/ServiceLoader::stream → KILLED
|
final Optional<ParentComparisonHandler> matchedParentComparisonHandler = parentComparisonHandlerServices.stream() |
24
|
2
1. find : replaced call to java/util/stream/Stream::map with receiver → KILLED
2. find : removed call to java/util/stream/Stream::map → KILLED
|
.map(Provider::get) |
25
|
5
1. lambda$find$0 : replaced boolean return with true for net/bmahe/genetics4j/neat/combination/parentcompare/ParentComparisonHandlerLocator::lambda$find$0 → SURVIVED
2. find : replaced call to java/util/stream/Stream::filter with receiver → SURVIVED
3. find : removed call to java/util/stream/Stream::filter → KILLED
4. lambda$find$0 : removed call to net/bmahe/genetics4j/neat/combination/parentcompare/ParentComparisonHandler::canHandle → KILLED
5. lambda$find$0 : replaced boolean return with false for net/bmahe/genetics4j/neat/combination/parentcompare/ParentComparisonHandlerLocator::lambda$find$0 → KILLED
|
.filter(parentComparisonHandler -> parentComparisonHandler.canHandle(parentComparisonPolicy)) |
26
|
1
1. find : removed call to java/util/stream/Stream::findFirst → KILLED
|
.findFirst(); |
27
|
|
|
28
|
1
1. find : replaced return value with Optional.empty for net/bmahe/genetics4j/neat/combination/parentcompare/ParentComparisonHandlerLocator::find → KILLED
|
return matchedParentComparisonHandler; |
29
|
|
} |
30
|
|
} |
| | Mutations |
17 |
|
1.1 Location : <init> Killed by : net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest]/[method:shouldAlwaysReEnable()] removed call to java/util/ServiceLoader::load → KILLED
2.2 Location : <init> Killed by : net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest]/[method:shouldAlwaysReEnable()] Removed assignment to member variable parentComparisonHandlerServices → KILLED
|
23 |
|
1.1 Location : find Killed by : net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest]/[method:shouldAlwaysReEnable()] removed call to java/util/ServiceLoader::stream → KILLED
|
24 |
|
1.1 Location : find Killed by : net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest]/[method:shouldAlwaysReEnable()] replaced call to java/util/stream/Stream::map with receiver → KILLED
2.2 Location : find Killed by : net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest]/[method:shouldAlwaysReEnable()] removed call to java/util/stream/Stream::map → KILLED
|
25 |
|
1.1 Location : find Killed by : net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest]/[method:shouldAlwaysReEnable()] removed call to java/util/stream/Stream::filter → KILLED
2.2 Location : lambda$find$0 Killed by : none replaced boolean return with true for net/bmahe/genetics4j/neat/combination/parentcompare/ParentComparisonHandlerLocator::lambda$find$0 → SURVIVED
Covering tests
Covered by tests:
- net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest]/[method:shouldAlwaysReEnable()]
- net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest]/[method:shouldNeverReEnable()]
- net.bmahe.genetics4j.neat.combination.NeatCombinationHandlerTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.combination.NeatCombinationHandlerTest]/[method:resolve()]
- net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest]/[method:combinePickBestReEnable()]
- net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest]/[method:combinePickBestNoReEnable()]
- net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest]/[method:combinePickWorstNoReEnable()]
- net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest]/[method:combinePickWorstReEnable()]
3.3 Location : lambda$find$0 Killed by : net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest]/[method:shouldAlwaysReEnable()] removed call to net/bmahe/genetics4j/neat/combination/parentcompare/ParentComparisonHandler::canHandle → KILLED
4.4 Location : find Killed by : none replaced call to java/util/stream/Stream::filter with receiver → SURVIVED
Covering tests
Covered by tests:
- net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest]/[method:shouldAlwaysReEnable()]
- net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest]/[method:shouldNeverReEnable()]
- net.bmahe.genetics4j.neat.combination.NeatCombinationHandlerTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.combination.NeatCombinationHandlerTest]/[method:resolve()]
- net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest]/[method:combinePickBestReEnable()]
- net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest]/[method:combinePickBestNoReEnable()]
- net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest]/[method:combinePickWorstNoReEnable()]
- net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest]/[method:combinePickWorstReEnable()]
5.5 Location : lambda$find$0 Killed by : net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest]/[method:shouldAlwaysReEnable()] replaced boolean return with false for net/bmahe/genetics4j/neat/combination/parentcompare/ParentComparisonHandlerLocator::lambda$find$0 → KILLED
|
26 |
|
1.1 Location : find Killed by : net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest]/[method:shouldAlwaysReEnable()] removed call to java/util/stream/Stream::findFirst → KILLED
|
28 |
|
1.1 Location : find Killed by : net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest]/[method:shouldAlwaysReEnable()] replaced return value with Optional.empty for net/bmahe/genetics4j/neat/combination/parentcompare/ParentComparisonHandlerLocator::find → KILLED
|