ParentComparisonHandlerLocator.java

1
package net.bmahe.genetics4j.neat.combination.parentcompare;
2
3
import java.util.Objects;
4
import java.util.Optional;
5
import java.util.ServiceLoader;
6
import java.util.ServiceLoader.Provider;
7
8
import net.bmahe.genetics4j.neat.spec.combination.parentcompare.ParentComparisonPolicy;
9
10
public class ParentComparisonHandlerLocator {
11
12
	private final ServiceLoader<ParentComparisonHandler> parentComparisonHandlerServices;
13
14
	public ParentComparisonHandlerLocator() {
15
16 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);
17
	}
18
19
	public Optional<ParentComparisonHandler> find(final ParentComparisonPolicy parentComparisonPolicy) {
20
		Objects.requireNonNull(parentComparisonPolicy);
21
22 2 1. find : removed call to java/util/ServiceLoader::stream → KILLED
2. find : replaced return value with Optional.empty for net/bmahe/genetics4j/neat/combination/parentcompare/ParentComparisonHandlerLocator::find → KILLED
		return parentComparisonHandlerServices.stream()
23 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)
24 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))
25 1 1. find : removed call to java/util/stream/Stream::findFirst → KILLED
				.findFirst();
26
	}
27
}

Mutations

16

1.1
Location : <init>
Killed by : net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest]/[method:shouldNeverReEnable()]
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:shouldNeverReEnable()]
Removed assignment to member variable parentComparisonHandlerServices → KILLED

22

1.1
Location : find
Killed by : net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest]/[method:shouldNeverReEnable()]
removed call to java/util/ServiceLoader::stream → KILLED

2.2
Location : find
Killed by : net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.neat.combination.NeatChromosomeCombinatorTest]/[method:shouldNeverReEnable()]
replaced return value with Optional.empty for net/bmahe/genetics4j/neat/combination/parentcompare/ParentComparisonHandlerLocator::find → 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:shouldNeverReEnable()]
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:shouldNeverReEnable()]
removed call to java/util/stream/Stream::map → 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:shouldNeverReEnable()]
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

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:shouldNeverReEnable()]
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

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:shouldNeverReEnable()]
replaced boolean return with false for net/bmahe/genetics4j/neat/combination/parentcompare/ParentComparisonHandlerLocator::lambda$find$0 → 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:shouldNeverReEnable()]
removed call to java/util/stream/Stream::findFirst → KILLED

Active mutators

Tests examined


Report generated by PIT 1.25.7 support