Population.java

1
package net.bmahe.genetics4j.core;
2
3
import java.util.ArrayList;
4
import java.util.Iterator;
5
import java.util.List;
6
import java.util.Objects;
7
8
import org.apache.commons.lang3.Validate;
9
10
/**
11
 * Represents a population of individuals in an evolutionary algorithm.
12
 * 
13
 * <p>A population is a collection of {@link Individual}s, each consisting of a genotype and its associated fitness.
14
 * This class provides methods to manage, access, and iterate over the individuals in the population.
15
 * 
16
 * <p>Populations are mutable and support adding individuals, either individually or in bulk from other populations. The
17
 * class maintains parallel lists of genotypes and fitnesses for efficient access.
18
 * 
19
 * @param <T> the type of the fitness values, must be comparable for selection operations
20
 * @see Individual
21
 * @see Genotype
22
 */
23
public class Population<T extends Comparable<T>> implements Iterable<Individual<T>> {
24
25
	private List<Genotype> genotypes;
26
	private List<T> fitnesses;
27
28
	/**
29
	 * Creates an empty population.
30
	 */
31
	public Population() {
32 2 1. <init> : Removed assignment to member variable genotypes → KILLED
2. <init> : removed call to java/util/ArrayList::<init> → KILLED
		this.genotypes = new ArrayList<>();
33 2 1. <init> : Removed assignment to member variable fitnesses → KILLED
2. <init> : removed call to java/util/ArrayList::<init> → KILLED
		this.fitnesses = new ArrayList<>();
34
	}
35
36
	/**
37
	 * Creates a population with the specified genotypes and fitnesses.
38
	 * 
39
	 * @param _genotype  the list of genotypes for the population
40
	 * @param _fitnesses the list of fitness values corresponding to the genotypes
41
	 * @throws IllegalArgumentException if genotypes or fitnesses are null, or if their sizes don't match
42
	 */
43
	public Population(final List<Genotype> _genotype, final List<T> _fitnesses) {
44
		Objects.requireNonNull(_genotype);
45
		Objects.requireNonNull(_fitnesses);
46
		Validate.isTrue(_genotype.size() == _fitnesses.size(),
47
				"Size of genotype (%d) does not match size of fitnesses (%d)",
48 3 1. <init> : removed call to java/lang/Integer::valueOf → SURVIVED
2. <init> : Substituted 1 with 0 → SURVIVED
3. <init> : removed call to java/util/List::size → SURVIVED
				_genotype.size(),
49 2 1. <init> : removed call to java/lang/Integer::valueOf → SURVIVED
2. <init> : removed call to java/util/List::size → SURVIVED
				_fitnesses.size());
50
51 2 1. <init> : Removed assignment to member variable genotypes → KILLED
2. <init> : removed call to java/util/ArrayList::<init> → KILLED
		this.genotypes = new ArrayList<Genotype>(_genotype);
52 2 1. <init> : Removed assignment to member variable fitnesses → KILLED
2. <init> : removed call to java/util/ArrayList::<init> → KILLED
		this.fitnesses = new ArrayList<>(_fitnesses);
53
	}
54
55
	/**
56
	 * Adds an individual to the population by specifying its genotype and fitness separately.
57
	 * 
58
	 * @param genotype the genotype of the individual to add
59
	 * @param fitness  the fitness value of the individual to add
60
	 * @throws IllegalArgumentException if genotype or fitness is null
61
	 */
62
	public void add(final Genotype genotype, final T fitness) {
63
		Objects.requireNonNull(genotype);
64
		Objects.requireNonNull(fitness);
65
66 1 1. add : removed call to java/util/List::add → KILLED
		genotypes.add(genotype);
67 1 1. add : removed call to java/util/List::add → KILLED
		fitnesses.add(fitness);
68
	}
69
70
	/**
71
	 * Adds an individual to the population.
72
	 * 
73
	 * @param individual the individual to add to the population
74
	 * @throws IllegalArgumentException if individual is null
75
	 */
76
	public void add(final Individual<T> individual) {
77
		Objects.requireNonNull(individual);
78
79 2 1. add : removed call to java/util/List::add → TIMED_OUT
2. add : removed call to net/bmahe/genetics4j/core/Individual::genotype → KILLED
		genotypes.add(individual.genotype());
80 2 1. add : removed call to net/bmahe/genetics4j/core/Individual::fitness → KILLED
2. add : removed call to java/util/List::add → KILLED
		fitnesses.add(individual.fitness());
81
	}
82
83
	/**
84
	 * Adds all individuals from another population to this population.
85
	 * 
86
	 * @param population the population whose individuals should be added to this population
87
	 * @throws IllegalArgumentException if population is null
88
	 */
89
	public void addAll(final Population<T> population) {
90
		Objects.requireNonNull(population);
91
92 2 1. addAll : removed call to java/util/List::addAll → KILLED
2. addAll : removed call to net/bmahe/genetics4j/core/Population::getAllGenotypes → KILLED
		this.genotypes.addAll(population.getAllGenotypes());
93 2 1. addAll : removed call to java/util/List::addAll → KILLED
2. addAll : removed call to net/bmahe/genetics4j/core/Population::getAllFitnesses → KILLED
		this.fitnesses.addAll(population.getAllFitnesses());
94
	}
95
96
	@Override
97
	public Iterator<Individual<T>> iterator() {
98 2 1. iterator : replaced return value with null for net/bmahe/genetics4j/core/Population::iterator → KILLED
2. iterator : removed call to net/bmahe/genetics4j/core/PopulationIterator::<init> → KILLED
		return new PopulationIterator<>(this);
99
	}
100
101
	/**
102
	 * Returns the genotype at the specified index.
103
	 * 
104
	 * @param index the index of the genotype to retrieve (0-based)
105
	 * @return the genotype at the specified index
106
	 * @throws IllegalArgumentException if index is out of bounds
107
	 */
108
	public Genotype getGenotype(final int index) {
109
		Validate.inclusiveBetween(0, genotypes.size() - 1, index);
110
111 2 1. getGenotype : removed call to java/util/List::get → KILLED
2. getGenotype : replaced return value with null for net/bmahe/genetics4j/core/Population::getGenotype → KILLED
		return genotypes.get(index);
112
	}
113
114
	/**
115
	 * Returns the fitness value at the specified index.
116
	 * 
117
	 * @param index the index of the fitness value to retrieve (0-based)
118
	 * @return the fitness value at the specified index
119
	 * @throws IllegalArgumentException if index is out of bounds
120
	 */
121
	public T getFitness(final int index) {
122
		Validate.inclusiveBetween(0, fitnesses.size() - 1, index);
123
124 2 1. getFitness : replaced return value with null for net/bmahe/genetics4j/core/Population::getFitness → KILLED
2. getFitness : removed call to java/util/List::get → KILLED
		return fitnesses.get(index);
125
	}
126
127
	/**
128
	 * Returns the individual at the specified index.
129
	 * 
130
	 * @param index the index of the individual to retrieve (0-based)
131
	 * @return the individual at the specified index, combining its genotype and fitness
132
	 * @throws IllegalArgumentException if index is out of bounds
133
	 */
134
	public Individual<T> getIndividual(final int index) {
135 4 1. getIndividual : removed call to net/bmahe/genetics4j/core/Population::getGenotype → KILLED
2. getIndividual : removed call to net/bmahe/genetics4j/core/Population::getFitness → KILLED
3. getIndividual : replaced return value with null for net/bmahe/genetics4j/core/Population::getIndividual → KILLED
4. getIndividual : removed call to net/bmahe/genetics4j/core/Individual::of → KILLED
		return Individual.of(getGenotype(index), getFitness(index));
136
	}
137
138
	/**
139
	 * Returns all genotypes in this population.
140
	 * 
141
	 * @return a list containing all genotypes in this population
142
	 */
143
	public List<Genotype> getAllGenotypes() {
144 1 1. getAllGenotypes : replaced return value with Collections.emptyList for net/bmahe/genetics4j/core/Population::getAllGenotypes → KILLED
		return genotypes;
145
	}
146
147
	/**
148
	 * Returns all fitness values in this population.
149
	 * 
150
	 * @return a list containing all fitness values in this population
151
	 */
152
	public List<T> getAllFitnesses() {
153 1 1. getAllFitnesses : replaced return value with Collections.emptyList for net/bmahe/genetics4j/core/Population::getAllFitnesses → KILLED
		return fitnesses;
154
	}
155
156
	/**
157
	 * Returns the number of individuals in this population.
158
	 * 
159
	 * @return the size of the population
160
	 */
161
	public int size() {
162 2 1. size : replaced int return with 0 for net/bmahe/genetics4j/core/Population::size → KILLED
2. size : removed call to java/util/List::size → KILLED
		return genotypes.size();
163
	}
164
165
	/**
166
	 * Checks if this population is empty.
167
	 * 
168
	 * @return {@code true} if the population contains no individuals, {@code false} otherwise
169
	 */
170
	public boolean isEmpty() {
171 7 1. isEmpty : removed call to net/bmahe/genetics4j/core/Population::size → KILLED
2. isEmpty : Substituted 1 with 0 → KILLED
3. isEmpty : negated conditional → KILLED
4. isEmpty : removed conditional - replaced equality check with false → KILLED
5. isEmpty : removed conditional - replaced equality check with true → KILLED
6. isEmpty : Substituted 0 with 1 → KILLED
7. isEmpty : replaced boolean return with true for net/bmahe/genetics4j/core/Population::isEmpty → KILLED
		return size() == 0;
172
	}
173
174
	@Override
175
	public int hashCode() {
176 1 1. hashCode : Substituted 31 with 32 → NO_COVERAGE
		final int prime = 31;
177 1 1. hashCode : Substituted 1 with 0 → NO_COVERAGE
		int result = 1;
178 8 1. hashCode : Substituted 0 with 1 → NO_COVERAGE
2. hashCode : negated conditional → NO_COVERAGE
3. hashCode : Substituted 31 with 32 → NO_COVERAGE
4. hashCode : Replaced integer addition with subtraction → NO_COVERAGE
5. hashCode : removed call to java/util/List::hashCode → NO_COVERAGE
6. hashCode : removed conditional - replaced equality check with false → NO_COVERAGE
7. hashCode : removed conditional - replaced equality check with true → NO_COVERAGE
8. hashCode : Replaced integer multiplication with division → NO_COVERAGE
		result = prime * result + ((fitnesses == null) ? 0 : fitnesses.hashCode());
179 8 1. hashCode : removed call to java/util/List::hashCode → NO_COVERAGE
2. hashCode : Replaced integer multiplication with division → NO_COVERAGE
3. hashCode : Substituted 0 with 1 → NO_COVERAGE
4. hashCode : Replaced integer addition with subtraction → NO_COVERAGE
5. hashCode : negated conditional → NO_COVERAGE
6. hashCode : Substituted 31 with 32 → NO_COVERAGE
7. hashCode : removed conditional - replaced equality check with false → NO_COVERAGE
8. hashCode : removed conditional - replaced equality check with true → NO_COVERAGE
		result = prime * result + ((genotypes == null) ? 0 : genotypes.hashCode());
180 1 1. hashCode : replaced int return with 0 for net/bmahe/genetics4j/core/Population::hashCode → NO_COVERAGE
		return result;
181
	}
182
183
	@Override
184
	public boolean equals(Object obj) {
185 2 1. equals : negated conditional → KILLED
2. equals : removed conditional - replaced equality check with true → KILLED
		if (this == obj)
186 2 1. equals : replaced boolean return with false for net/bmahe/genetics4j/core/Population::equals → NO_COVERAGE
2. equals : Substituted 1 with 0 → NO_COVERAGE
			return true;
187 3 1. equals : negated conditional → SURVIVED
2. equals : removed conditional - replaced equality check with true → SURVIVED
3. equals : removed conditional - replaced equality check with false → SURVIVED
		if (obj == null)
188 2 1. equals : replaced boolean return with true for net/bmahe/genetics4j/core/Population::equals → NO_COVERAGE
2. equals : Substituted 0 with 1 → NO_COVERAGE
			return false;
189 5 1. equals : removed call to java/lang/Object::getClass → SURVIVED
2. equals : removed conditional - replaced equality check with true → SURVIVED
3. equals : negated conditional → SURVIVED
4. equals : removed conditional - replaced equality check with false → SURVIVED
5. equals : removed call to java/lang/Object::getClass → SURVIVED
		if (getClass() != obj.getClass())
190 2 1. equals : Substituted 0 with 1 → NO_COVERAGE
2. equals : replaced boolean return with true for net/bmahe/genetics4j/core/Population::equals → NO_COVERAGE
			return false;
191
192
		@SuppressWarnings("rawtypes")
193
		Population other = (Population) obj;
194 3 1. equals : removed conditional - replaced equality check with true → SURVIVED
2. equals : removed conditional - replaced equality check with false → SURVIVED
3. equals : negated conditional → SURVIVED
		if (fitnesses == null) {
195 3 1. equals : removed conditional - replaced equality check with false → NO_COVERAGE
2. equals : negated conditional → NO_COVERAGE
3. equals : removed conditional - replaced equality check with true → NO_COVERAGE
			if (other.fitnesses != null)
196 2 1. equals : replaced boolean return with true for net/bmahe/genetics4j/core/Population::equals → NO_COVERAGE
2. equals : Substituted 0 with 1 → NO_COVERAGE
				return false;
197 4 1. equals : removed call to java/util/List::equals → SURVIVED
2. equals : removed conditional - replaced equality check with true → SURVIVED
3. equals : negated conditional → SURVIVED
4. equals : removed conditional - replaced equality check with false → SURVIVED
		} else if (!fitnesses.equals(other.fitnesses))
198 2 1. equals : Substituted 0 with 1 → KILLED
2. equals : replaced boolean return with true for net/bmahe/genetics4j/core/Population::equals → KILLED
			return false;
199 3 1. equals : removed conditional - replaced equality check with true → NO_COVERAGE
2. equals : removed conditional - replaced equality check with false → NO_COVERAGE
3. equals : negated conditional → NO_COVERAGE
		if (genotypes == null) {
200 3 1. equals : removed conditional - replaced equality check with true → NO_COVERAGE
2. equals : removed conditional - replaced equality check with false → NO_COVERAGE
3. equals : negated conditional → NO_COVERAGE
			if (other.genotypes != null)
201 2 1. equals : replaced boolean return with true for net/bmahe/genetics4j/core/Population::equals → NO_COVERAGE
2. equals : Substituted 0 with 1 → NO_COVERAGE
				return false;
202 4 1. equals : removed conditional - replaced equality check with false → NO_COVERAGE
2. equals : removed call to java/util/List::equals → NO_COVERAGE
3. equals : negated conditional → NO_COVERAGE
4. equals : removed conditional - replaced equality check with true → NO_COVERAGE
		} else if (!genotypes.equals(other.genotypes))
203 2 1. equals : replaced boolean return with true for net/bmahe/genetics4j/core/Population::equals → NO_COVERAGE
2. equals : Substituted 0 with 1 → NO_COVERAGE
			return false;
204 2 1. equals : Substituted 1 with 0 → NO_COVERAGE
2. equals : replaced boolean return with false for net/bmahe/genetics4j/core/Population::equals → NO_COVERAGE
		return true;
205
	}
206
207
	@Override
208
	public String toString() {
209 3 1. toString : removed call to java/lang/String::valueOf → SURVIVED
2. toString : replaced return value with "" for net/bmahe/genetics4j/core/Population::toString → SURVIVED
3. toString : removed call to java/lang/String::valueOf → SURVIVED
		return "Population [genotypes=" + genotypes + ", fitnesses=" + fitnesses + "]";
210
	}
211
212
	/**
213
	 * Creates a new population with the specified genotypes and fitnesses.
214
	 * 
215
	 * @param <U>        the type of the fitness values
216
	 * @param _genotype  the list of genotypes for the population
217
	 * @param _fitnesses the list of fitness values corresponding to the genotypes
218
	 * @return a new population containing the specified genotypes and fitnesses
219
	 * @throws IllegalArgumentException if genotypes or fitnesses are null, or if their sizes don't match
220
	 */
221
	public static <U extends Comparable<U>> Population<U> of(final List<Genotype> _genotype, final List<U> _fitnesses) {
222 2 1. of : removed call to net/bmahe/genetics4j/core/Population::<init> → KILLED
2. of : replaced return value with null for net/bmahe/genetics4j/core/Population::of → KILLED
		return new Population<U>(_genotype, _fitnesses);
223
	}
224
225
	/**
226
	 * Creates a new population from a list of individuals.
227
	 * 
228
	 * @param <U>         the type of the fitness values
229
	 * @param individuals the list of individuals to include in the population
230
	 * @return a new population containing the specified individuals
231
	 * @throws IllegalArgumentException if individuals list is null
232
	 */
233
	public static <U extends Comparable<U>> Population<U> of(final List<Individual<U>> individuals) {
234
		Objects.requireNonNull(individuals);
235
236 1 1. of : removed call to java/util/List::stream → NO_COVERAGE
		final List<Genotype> genotypes = individuals.stream()
237 2 1. of : removed call to java/util/stream/Stream::map → NO_COVERAGE
2. of : replaced call to java/util/stream/Stream::map with receiver → NO_COVERAGE
				.map(Individual::genotype)
238 1 1. of : removed call to java/util/stream/Stream::toList → NO_COVERAGE
				.toList();
239
240 1 1. of : removed call to java/util/List::stream → NO_COVERAGE
		final List<U> fitnesses = individuals.stream()
241 2 1. of : replaced call to java/util/stream/Stream::map with receiver → NO_COVERAGE
2. of : removed call to java/util/stream/Stream::map → NO_COVERAGE
				.map(Individual::fitness)
242 1 1. of : removed call to java/util/stream/Stream::toList → NO_COVERAGE
				.toList();
243
244 2 1. of : replaced return value with null for net/bmahe/genetics4j/core/Population::of → NO_COVERAGE
2. of : removed call to net/bmahe/genetics4j/core/Population::<init> → NO_COVERAGE
		return new Population<U>(genotypes, fitnesses);
245
	}
246
247
	/**
248
	 * Creates an empty population.
249
	 * 
250
	 * @param <U> the type of the fitness values
251
	 * @return a new empty population
252
	 */
253
	public static <U extends Comparable<U>> Population<U> empty() {
254 4 1. empty : replaced return value with null for net/bmahe/genetics4j/core/Population::empty → NO_COVERAGE
2. empty : removed call to net/bmahe/genetics4j/core/Population::<init> → NO_COVERAGE
3. empty : removed call to java/util/List::of → NO_COVERAGE
4. empty : removed call to java/util/List::of → NO_COVERAGE
		return new Population<U>(List.of(), List.of());
255
	}
256
257
}

Mutations

32

1.1
Location : <init>
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:empty()]
Removed assignment to member variable genotypes → KILLED

2.2
Location : <init>
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:empty()]
removed call to java/util/ArrayList::<init> → KILLED

33

1.1
Location : <init>
Killed by : net.bmahe.genetics4j.core.postevaluationprocess.FitnessSharingTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.postevaluationprocess.FitnessSharingTest]/[method:simple()]
Removed assignment to member variable fitnesses → KILLED

2.2
Location : <init>
Killed by : net.bmahe.genetics4j.core.postevaluationprocess.FitnessSharingTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.postevaluationprocess.FitnessSharingTest]/[method:simple()]
removed call to java/util/ArrayList::<init> → KILLED

48

1.1
Location : <init>
Killed by : none
removed call to java/lang/Integer::valueOf → SURVIVED
Covering tests

2.2
Location : <init>
Killed by : none
Substituted 1 with 0 → SURVIVED Covering tests

3.3
Location : <init>
Killed by : none
removed call to java/util/List::size → SURVIVED Covering tests

49

1.1
Location : <init>
Killed by : none
removed call to java/lang/Integer::valueOf → SURVIVED
Covering tests

2.2
Location : <init>
Killed by : none
removed call to java/util/List::size → SURVIVED Covering tests

51

1.1
Location : <init>
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
Removed assignment to member variable genotypes → KILLED

2.2
Location : <init>
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
removed call to java/util/ArrayList::<init> → KILLED

52

1.1
Location : <init>
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
Removed assignment to member variable fitnesses → KILLED

2.2
Location : <init>
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
removed call to java/util/ArrayList::<init> → KILLED

66

1.1
Location : add
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
removed call to java/util/List::add → KILLED

67

1.1
Location : add
Killed by : net.bmahe.genetics4j.core.postevaluationprocess.FitnessSharingTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.postevaluationprocess.FitnessSharingTest]/[method:simple()]
removed call to java/util/List::add → KILLED

79

1.1
Location : add
Killed by : net.bmahe.genetics4j.core.selection.TournamentSelectionPolicyHandlerTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.selection.TournamentSelectionPolicyHandlerTest]/[method:selectMaximize()]
removed call to net/bmahe/genetics4j/core/Individual::genotype → KILLED

2.2
Location : add
Killed by : none
removed call to java/util/List::add → TIMED_OUT

80

1.1
Location : add
Killed by : net.bmahe.genetics4j.core.selection.SelectiveRefinementTournamentSelectorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.selection.SelectiveRefinementTournamentSelectorTest]/[method:selectWithoutRefinement()]
removed call to net/bmahe/genetics4j/core/Individual::fitness → KILLED

2.2
Location : add
Killed by : net.bmahe.genetics4j.core.selection.SelectiveRefinementTournamentSelectorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.selection.SelectiveRefinementTournamentSelectorTest]/[method:selectWithoutRefinement()]
removed call to java/util/List::add → KILLED

92

1.1
Location : addAll
Killed by : net.bmahe.genetics4j.core.replacement.DeleteNLastImplTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.replacement.DeleteNLastImplTest]/[method:select()]
removed call to java/util/List::addAll → KILLED

2.2
Location : addAll
Killed by : net.bmahe.genetics4j.core.replacement.DeleteNLastImplTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.replacement.DeleteNLastImplTest]/[method:select()]
removed call to net/bmahe/genetics4j/core/Population::getAllGenotypes → KILLED

93

1.1
Location : addAll
Killed by : net.bmahe.genetics4j.core.replacement.ElitismImplTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.replacement.ElitismImplTest]/[method:simple()]
removed call to java/util/List::addAll → KILLED

2.2
Location : addAll
Killed by : net.bmahe.genetics4j.core.replacement.DeleteNLastImplTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.replacement.DeleteNLastImplTest]/[method:select()]
removed call to net/bmahe/genetics4j/core/Population::getAllFitnesses → KILLED

98

1.1
Location : iterator
Killed by : net.bmahe.genetics4j.core.PopulationIteratorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationIteratorTest]/[method:iteratorIntegrationWithEnhancedForLoop()]
replaced return value with null for net/bmahe/genetics4j/core/Population::iterator → KILLED

2.2
Location : iterator
Killed by : net.bmahe.genetics4j.core.PopulationIteratorTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationIteratorTest]/[method:iteratorIntegrationWithEnhancedForLoop()]
removed call to net/bmahe/genetics4j/core/PopulationIterator::<init> → KILLED

111

1.1
Location : getGenotype
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
removed call to java/util/List::get → KILLED

2.2
Location : getGenotype
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
replaced return value with null for net/bmahe/genetics4j/core/Population::getGenotype → KILLED

124

1.1
Location : getFitness
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
replaced return value with null for net/bmahe/genetics4j/core/Population::getFitness → KILLED

2.2
Location : getFitness
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
removed call to java/util/List::get → KILLED

135

1.1
Location : getIndividual
Killed by : net.bmahe.genetics4j.core.postevaluationprocess.FitnessSharingTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.postevaluationprocess.FitnessSharingTest]/[method:simple()]
removed call to net/bmahe/genetics4j/core/Population::getGenotype → KILLED

2.2
Location : getIndividual
Killed by : net.bmahe.genetics4j.core.postevaluationprocess.FitnessSharingTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.postevaluationprocess.FitnessSharingTest]/[method:simple()]
removed call to net/bmahe/genetics4j/core/Population::getFitness → KILLED

3.3
Location : getIndividual
Killed by : net.bmahe.genetics4j.core.postevaluationprocess.FitnessSharingTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.postevaluationprocess.FitnessSharingTest]/[method:simple()]
replaced return value with null for net/bmahe/genetics4j/core/Population::getIndividual → KILLED

4.4
Location : getIndividual
Killed by : net.bmahe.genetics4j.core.postevaluationprocess.FitnessSharingTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.postevaluationprocess.FitnessSharingTest]/[method:simple()]
removed call to net/bmahe/genetics4j/core/Individual::of → KILLED

144

1.1
Location : getAllGenotypes
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
replaced return value with Collections.emptyList for net/bmahe/genetics4j/core/Population::getAllGenotypes → KILLED

153

1.1
Location : getAllFitnesses
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
replaced return value with Collections.emptyList for net/bmahe/genetics4j/core/Population::getAllFitnesses → KILLED

162

1.1
Location : size
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
replaced int return with 0 for net/bmahe/genetics4j/core/Population::size → KILLED

2.2
Location : size
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
removed call to java/util/List::size → KILLED

171

1.1
Location : isEmpty
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
removed call to net/bmahe/genetics4j/core/Population::size → KILLED

2.2
Location : isEmpty
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:empty()]
Substituted 1 with 0 → KILLED

3.3
Location : isEmpty
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:empty()]
negated conditional → KILLED

4.4
Location : isEmpty
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:empty()]
removed conditional - replaced equality check with false → KILLED

5.5
Location : isEmpty
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
removed conditional - replaced equality check with true → KILLED

6.6
Location : isEmpty
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
Substituted 0 with 1 → KILLED

7.7
Location : isEmpty
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
replaced boolean return with true for net/bmahe/genetics4j/core/Population::isEmpty → KILLED

176

1.1
Location : hashCode
Killed by : none
Substituted 31 with 32 → NO_COVERAGE

177

1.1
Location : hashCode
Killed by : none
Substituted 1 with 0 → NO_COVERAGE

178

1.1
Location : hashCode
Killed by : none
Substituted 0 with 1 → NO_COVERAGE

2.2
Location : hashCode
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location : hashCode
Killed by : none
Substituted 31 with 32 → NO_COVERAGE

4.4
Location : hashCode
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

5.5
Location : hashCode
Killed by : none
removed call to java/util/List::hashCode → NO_COVERAGE

6.6
Location : hashCode
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

7.7
Location : hashCode
Killed by : none
removed conditional - replaced equality check with true → NO_COVERAGE

8.8
Location : hashCode
Killed by : none
Replaced integer multiplication with division → NO_COVERAGE

179

1.1
Location : hashCode
Killed by : none
removed call to java/util/List::hashCode → NO_COVERAGE

2.2
Location : hashCode
Killed by : none
Replaced integer multiplication with division → NO_COVERAGE

3.3
Location : hashCode
Killed by : none
Substituted 0 with 1 → NO_COVERAGE

4.4
Location : hashCode
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

5.5
Location : hashCode
Killed by : none
negated conditional → NO_COVERAGE

6.6
Location : hashCode
Killed by : none
Substituted 31 with 32 → NO_COVERAGE

7.7
Location : hashCode
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

8.8
Location : hashCode
Killed by : none
removed conditional - replaced equality check with true → NO_COVERAGE

180

1.1
Location : hashCode
Killed by : none
replaced int return with 0 for net/bmahe/genetics4j/core/Population::hashCode → NO_COVERAGE

185

1.1
Location : equals
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
negated conditional → KILLED

2.2
Location : equals
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
removed conditional - replaced equality check with true → KILLED

186

1.1
Location : equals
Killed by : none
replaced boolean return with false for net/bmahe/genetics4j/core/Population::equals → NO_COVERAGE

2.2
Location : equals
Killed by : none
Substituted 1 with 0 → NO_COVERAGE

187

1.1
Location : equals
Killed by : none
negated conditional → SURVIVED
Covering tests

2.2
Location : equals
Killed by : none
removed conditional - replaced equality check with true → SURVIVED Covering tests

3.3
Location : equals
Killed by : none
removed conditional - replaced equality check with false → SURVIVED Covering tests

188

1.1
Location : equals
Killed by : none
replaced boolean return with true for net/bmahe/genetics4j/core/Population::equals → NO_COVERAGE

2.2
Location : equals
Killed by : none
Substituted 0 with 1 → NO_COVERAGE

189

1.1
Location : equals
Killed by : none
removed call to java/lang/Object::getClass → SURVIVED
Covering tests

2.2
Location : equals
Killed by : none
removed conditional - replaced equality check with true → SURVIVED Covering tests

3.3
Location : equals
Killed by : none
negated conditional → SURVIVED Covering tests

4.4
Location : equals
Killed by : none
removed conditional - replaced equality check with false → SURVIVED Covering tests

5.5
Location : equals
Killed by : none
removed call to java/lang/Object::getClass → SURVIVED Covering tests

190

1.1
Location : equals
Killed by : none
Substituted 0 with 1 → NO_COVERAGE

2.2
Location : equals
Killed by : none
replaced boolean return with true for net/bmahe/genetics4j/core/Population::equals → NO_COVERAGE

194

1.1
Location : equals
Killed by : none
removed conditional - replaced equality check with true → SURVIVED
Covering tests

2.2
Location : equals
Killed by : none
removed conditional - replaced equality check with false → SURVIVED Covering tests

3.3
Location : equals
Killed by : none
negated conditional → SURVIVED Covering tests

195

1.1
Location : equals
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

2.2
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location : equals
Killed by : none
removed conditional - replaced equality check with true → NO_COVERAGE

196

1.1
Location : equals
Killed by : none
replaced boolean return with true for net/bmahe/genetics4j/core/Population::equals → NO_COVERAGE

2.2
Location : equals
Killed by : none
Substituted 0 with 1 → NO_COVERAGE

197

1.1
Location : equals
Killed by : none
removed call to java/util/List::equals → SURVIVED
Covering tests

2.2
Location : equals
Killed by : none
removed conditional - replaced equality check with true → SURVIVED Covering tests

3.3
Location : equals
Killed by : none
negated conditional → SURVIVED Covering tests

4.4
Location : equals
Killed by : none
removed conditional - replaced equality check with false → SURVIVED Covering tests

198

1.1
Location : equals
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
Substituted 0 with 1 → KILLED

2.2
Location : equals
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
replaced boolean return with true for net/bmahe/genetics4j/core/Population::equals → KILLED

199

1.1
Location : equals
Killed by : none
removed conditional - replaced equality check with true → NO_COVERAGE

2.2
Location : equals
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

3.3
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

200

1.1
Location : equals
Killed by : none
removed conditional - replaced equality check with true → NO_COVERAGE

2.2
Location : equals
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

3.3
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

201

1.1
Location : equals
Killed by : none
replaced boolean return with true for net/bmahe/genetics4j/core/Population::equals → NO_COVERAGE

2.2
Location : equals
Killed by : none
Substituted 0 with 1 → NO_COVERAGE

202

1.1
Location : equals
Killed by : none
removed conditional - replaced equality check with false → NO_COVERAGE

2.2
Location : equals
Killed by : none
removed call to java/util/List::equals → NO_COVERAGE

3.3
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

4.4
Location : equals
Killed by : none
removed conditional - replaced equality check with true → NO_COVERAGE

203

1.1
Location : equals
Killed by : none
replaced boolean return with true for net/bmahe/genetics4j/core/Population::equals → NO_COVERAGE

2.2
Location : equals
Killed by : none
Substituted 0 with 1 → NO_COVERAGE

204

1.1
Location : equals
Killed by : none
Substituted 1 with 0 → NO_COVERAGE

2.2
Location : equals
Killed by : none
replaced boolean return with false for net/bmahe/genetics4j/core/Population::equals → NO_COVERAGE

209

1.1
Location : toString
Killed by : none
removed call to java/lang/String::valueOf → SURVIVED
Covering tests

2.2
Location : toString
Killed by : none
replaced return value with "" for net/bmahe/genetics4j/core/Population::toString → SURVIVED Covering tests

3.3
Location : toString
Killed by : none
removed call to java/lang/String::valueOf → SURVIVED Covering tests

222

1.1
Location : of
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
removed call to net/bmahe/genetics4j/core/Population::<init> → KILLED

2.2
Location : of
Killed by : net.bmahe.genetics4j.core.PopulationTest.[engine:junit-jupiter]/[class:net.bmahe.genetics4j.core.PopulationTest]/[method:simple()]
replaced return value with null for net/bmahe/genetics4j/core/Population::of → KILLED

236

1.1
Location : of
Killed by : none
removed call to java/util/List::stream → NO_COVERAGE

237

1.1
Location : of
Killed by : none
removed call to java/util/stream/Stream::map → NO_COVERAGE

2.2
Location : of
Killed by : none
replaced call to java/util/stream/Stream::map with receiver → NO_COVERAGE

238

1.1
Location : of
Killed by : none
removed call to java/util/stream/Stream::toList → NO_COVERAGE

240

1.1
Location : of
Killed by : none
removed call to java/util/List::stream → NO_COVERAGE

241

1.1
Location : of
Killed by : none
replaced call to java/util/stream/Stream::map with receiver → NO_COVERAGE

2.2
Location : of
Killed by : none
removed call to java/util/stream/Stream::map → NO_COVERAGE

242

1.1
Location : of
Killed by : none
removed call to java/util/stream/Stream::toList → NO_COVERAGE

244

1.1
Location : of
Killed by : none
replaced return value with null for net/bmahe/genetics4j/core/Population::of → NO_COVERAGE

2.2
Location : of
Killed by : none
removed call to net/bmahe/genetics4j/core/Population::<init> → NO_COVERAGE

254

1.1
Location : empty
Killed by : none
replaced return value with null for net/bmahe/genetics4j/core/Population::empty → NO_COVERAGE

2.2
Location : empty
Killed by : none
removed call to net/bmahe/genetics4j/core/Population::<init> → NO_COVERAGE

3.3
Location : empty
Killed by : none
removed call to java/util/List::of → NO_COVERAGE

4.4
Location : empty
Killed by : none
removed call to java/util/List::of → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.20.3