CharSequences.java

1
/*-
2
 * #%L
3
 * io.earcam.utilitarian.charstar
4
 * %%
5
 * Copyright (C) 2017 - 2018 earcam
6
 * %%
7
 * SPDX-License-Identifier: (BSD-3-Clause OR EPL-1.0 OR Apache-2.0 OR MIT)
8
 *
9
 * You <b>must</b> choose to accept, in full - any individual or combination of
10
 * the following licenses:
11
 * <ul>
12
 * 	<li><a href="https://opensource.org/licenses/BSD-3-Clause">BSD-3-Clause</a></li>
13
 * 	<li><a href="https://www.eclipse.org/legal/epl-v10.html">EPL-1.0</a></li>
14
 * 	<li><a href="https://www.apache.org/licenses/LICENSE-2.0">Apache-2.0</a></li>
15
 * 	<li><a href="https://opensource.org/licenses/MIT">MIT</a></li>
16
 * </ul>
17
 * #L%
18
 */
19
package io.earcam.utilitarian.charstar;
20
21
import static java.nio.charset.StandardCharsets.UTF_8;
22
23
import java.nio.ByteBuffer;
24
import java.nio.CharBuffer;
25
import java.nio.charset.Charset;
26
import java.util.Arrays;
27
import java.util.Comparator;
28
29
import javax.annotation.Nullable;
30
import javax.annotation.ParametersAreNonnullByDefault;
31
32
@ParametersAreNonnullByDefault
33
public final class CharSequences {
34
35
	private CharSequences()
36
	{
37
38
	}
39
40
41
	static CharStar backedCharSequence(char[] sequence)
42
	{
43 1 1. backedCharSequence : mutated return of Object value for io/earcam/utilitarian/charstar/CharSequences::backedCharSequence to ( if (x != null) null else throw new RuntimeException ) → KILLED
		return CharStar.backedCharSequence(sequence);
44
	}
45
46
47
	static CharStar charSequence(char[] sequence)
48
	{
49
		char[] encapsulated = Arrays.copyOf(sequence, sequence.length);
50 1 1. charSequence : mutated return of Object value for io/earcam/utilitarian/charstar/CharSequences::charSequence to ( if (x != null) null else throw new RuntimeException ) → KILLED
		return CharStar.charSequence(encapsulated);
51
	}
52
53
54
	static CharStar charSequence(CharSequence sequence)
55
	{
56 1 1. charSequence : mutated return of Object value for io/earcam/utilitarian/charstar/CharSequences::charSequence to ( if (x != null) null else throw new RuntimeException ) → KILLED
		return CharStar.charSequence(toArray(sequence));
57
	}
58
59
60
	public static boolean startsWith(CharSequence text, CharSequence prefix)
61
	{
62 2 1. startsWith : changed conditional boundary → KILLED
2. startsWith : negated conditional → KILLED
		if(prefix.length() > text.length()) {
63 1 1. startsWith : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED
			return false;
64
		}
65 2 1. startsWith : changed conditional boundary → KILLED
2. startsWith : negated conditional → KILLED
		for(int i = 0; i < prefix.length(); i++) {
66 1 1. startsWith : negated conditional → KILLED
			if(text.charAt(i) != prefix.charAt(i)) {
67 1 1. startsWith : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED
				return false;
68
			}
69
		}
70 1 1. startsWith : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED
		return true;
71
	}
72
73
74
	public static boolean endsWith(CharSequence text, CharSequence suffix)
75
	{
76 2 1. endsWith : changed conditional boundary → KILLED
2. endsWith : negated conditional → KILLED
		if(suffix.length() > text.length()) {
77 1 1. endsWith : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED
			return false;
78
		}
79 6 1. endsWith : changed conditional boundary → KILLED
2. endsWith : Changed increment from -1 to 1 → KILLED
3. endsWith : Changed increment from -1 to 1 → KILLED
4. endsWith : Replaced integer subtraction with addition → KILLED
5. endsWith : Replaced integer subtraction with addition → KILLED
6. endsWith : negated conditional → KILLED
		for(int i = text.length() - 1, j = suffix.length() - 1; j >= 0; i--, j--) {
80 1 1. endsWith : negated conditional → KILLED
			if(text.charAt(i) != suffix.charAt(j)) {
81 1 1. endsWith : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED
				return false;
82
			}
83
		}
84 1 1. endsWith : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED
		return true;
85
	}
86
87
88
	public static boolean same(@Nullable CharSequence a, @Nullable CharSequence b)
89
	{
90 2 1. same : negated conditional → KILLED
2. same : negated conditional → KILLED
		if(a == null || b == null) {
91 2 1. same : negated conditional → KILLED
2. same : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED
			return a == b;
92
		}
93 1 1. same : negated conditional → KILLED
		if(a.length() != b.length()) {
94 1 1. same : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED
			return false;
95
		}
96 2 1. same : changed conditional boundary → KILLED
2. same : negated conditional → KILLED
		for(int i = 0; i < a.length(); i++) {
97 1 1. same : negated conditional → KILLED
			if(a.charAt(i) != b.charAt(i)) {
98 1 1. same : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED
				return false;
99
			}
100
		}
101 1 1. same : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED
		return true;
102
	}
103
104
105
	public static int hashCode(CharSequence sequence)
106
	{
107
		int hash = 0;
108 3 1. hashCode : changed conditional boundary → KILLED
2. hashCode : Changed increment from 1 to -1 → KILLED
3. hashCode : negated conditional → KILLED
		for(int i = 0; i < sequence.length(); i++) {
109 2 1. hashCode : Replaced integer multiplication with division → KILLED
2. hashCode : Replaced integer addition with subtraction → KILLED
			hash = 31 * hash + sequence.charAt(i);
110
		}
111 1 1. hashCode : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED
		return hash;
112
	}
113
114
115
	public static CharSequence trim(CharSequence padded)
116
	{
117
		int s = 0;
118
		int e = padded.length();
119 1 1. trim : negated conditional → KILLED
		while(Character.isWhitespace(padded.charAt(s))) {
120 1 1. trim : Changed increment from 1 to -1 → KILLED
			s += 1;
121
		}
122 2 1. trim : Replaced integer subtraction with addition → KILLED
2. trim : negated conditional → KILLED
		while(Character.isWhitespace(padded.charAt(e - 1))) {
123 1 1. trim : Changed increment from -1 to 1 → KILLED
			e -= 1;
124
		}
125 1 1. trim : mutated return of Object value for io/earcam/utilitarian/charstar/CharSequences::trim to ( if (x != null) null else throw new RuntimeException ) → KILLED
		return padded.subSequence(s, e);
126
	}
127
128
129
	public static @Nullable CharSequence replace(@Nullable CharSequence sequence, char find, char replace)
130
	{
131 1 1. replace : negated conditional → KILLED
		if(sequence == null) {
132 1 1. replace : mutated return of Object value for io/earcam/utilitarian/charstar/CharSequences::replace to ( if (x != null) null else throw new RuntimeException ) → KILLED
			return null;
133
		}
134
		char[] chars = new char[sequence.length()];
135 2 1. replace : changed conditional boundary → KILLED
2. replace : negated conditional → KILLED
		for(int i = 0; i < chars.length; i++) {
136
			chars[i] = sequence.charAt(i);
137 1 1. replace : negated conditional → KILLED
			if(chars[i] == find) {
138
				chars[i] = replace;
139
			}
140
		}
141 1 1. replace : mutated return of Object value for io/earcam/utilitarian/charstar/CharSequences::replace to ( if (x != null) null else throw new RuntimeException ) → KILLED
		return CharStar.backedCharSequence(chars);
142
	}
143
144
145
	/**
146
	 * Returns {@code true} if the argument {@code text} is {@code null} or {@link CharSequence#length()} {@code == 0}
147
	 * 
148
	 * @param text the CharSequence to test
149
	 * @return {@code true} IFF <i>empty</i>
150
	 */
151
	public static boolean isEmpty(@Nullable CharSequence text)
152
	{
153 3 1. isEmpty : negated conditional → KILLED
2. isEmpty : negated conditional → KILLED
3. isEmpty : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED
		return text == null || text.length() == 0;
154
	}
155
156
157
	/**
158
	 * Equivalent to {@link String#lastIndexOf(int)
159
	 * 
160
	 * @param text the CharSequence to test
161
	 * @param character the {@code char} to find
162
	 * @return the index of first occurrence of argument {@code character}
163
	 */
164
	public static int lastIndexOf(CharSequence text, char character)
165
	{
166 4 1. lastIndexOf : changed conditional boundary → KILLED
2. lastIndexOf : Changed increment from -1 to 1 → KILLED
3. lastIndexOf : Replaced integer subtraction with addition → KILLED
4. lastIndexOf : negated conditional → KILLED
		for(int i = text.length() - 1; i >= 0; i--) {
167 1 1. lastIndexOf : negated conditional → KILLED
			if(text.charAt(i) == character) {
168 1 1. lastIndexOf : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED
				return i;
169
			}
170
		}
171 1 1. lastIndexOf : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED
		return -1;
172
	}
173
174
175
	public static int indexOf(CharSequence text, char character)
176
	{
177 1 1. indexOf : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED
		return indexOf(text, character, 0);
178
	}
179
180
181
	public static int indexOf(CharSequence text, char character, int start)
182
	{
183 2 1. indexOf : changed conditional boundary → KILLED
2. indexOf : negated conditional → KILLED
		for(int i = start; i < text.length(); i++) {
184 1 1. indexOf : negated conditional → KILLED
			if(text.charAt(i) == character) {
185 1 1. indexOf : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED
				return i;
186
			}
187
		}
188 1 1. indexOf : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED
		return -1;
189
	}
190
191
192
	public static byte[] toBytes(CharSequence utf8Sequence)
193
	{
194 1 1. toBytes : mutated return of Object value for io/earcam/utilitarian/charstar/CharSequences::toBytes to ( if (x != null) null else throw new RuntimeException ) → KILLED
		return toBytes(utf8Sequence, UTF_8);
195
	}
196
197
198
	public static byte[] toBytes(CharSequence sequence, Charset charset)
199
	{
200
		ByteBuffer buffer = charset.encode(CharBuffer.wrap(sequence));
201
		byte[] bytes = new byte[buffer.remaining()];
202
		buffer.get(bytes);
203 1 1. toBytes : mutated return of Object value for io/earcam/utilitarian/charstar/CharSequences::toBytes to ( if (x != null) null else throw new RuntimeException ) → KILLED
		return bytes;
204
	}
205
206
207
	public static Comparator<CharSequence> comparator()
208
	{
209 1 1. comparator : mutated return of Object value for io/earcam/utilitarian/charstar/CharSequences::comparator to ( if (x != null) null else throw new RuntimeException ) → KILLED
		return CharSequences::compare;
210
	}
211
212
213
	public static int compare(CharSequence a, CharSequence b)
214
	{
215
		int max = Math.min(a.length(), b.length());
216
		int i = 0;
217 2 1. compare : changed conditional boundary → KILLED
2. compare : negated conditional → KILLED
		while(i < max) {
218
			char c1 = a.charAt(i);
219
			char c2 = b.charAt(i);
220 1 1. compare : negated conditional → KILLED
			if(c1 != c2) {
221 2 1. compare : Replaced integer subtraction with addition → KILLED
2. compare : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED
				return c1 - c2;
222
			}
223 1 1. compare : Changed increment from 1 to -1 → KILLED
			i++;
224
		}
225 2 1. compare : Replaced integer subtraction with addition → KILLED
2. compare : replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED
		return a.length() - b.length();
226
	}
227
228
229
	public static char[] toArray(CharSequence sequence)
230
	{
231
		char[] array = new char[sequence.length()];
232 2 1. toArray : changed conditional boundary → KILLED
2. toArray : negated conditional → KILLED
		for(int i = 0; i < array.length; i++) {
233
			array[i] = sequence.charAt(i);
234
		}
235 1 1. toArray : mutated return of Object value for io/earcam/utilitarian/charstar/CharSequences::toArray to ( if (x != null) null else throw new RuntimeException ) → KILLED
		return array;
236
	}
237
}

Mutations

43

1.1
Location : backedCharSequence
Killed by : io.earcam.utilitarian.charstar.CharStarTest.backedSubsequenceMaintainsMutableState()
mutated return of Object value for io/earcam/utilitarian/charstar/CharSequences::backedCharSequence to ( if (x != null) null else throw new RuntimeException ) → KILLED

50

1.1
Location : charSequence
Killed by : io.earcam.utilitarian.charstar.CharStarTest.compareToGreaterThan()
mutated return of Object value for io/earcam/utilitarian/charstar/CharSequences::charSequence to ( if (x != null) null else throw new RuntimeException ) → KILLED

56

1.1
Location : charSequence
Killed by : io.earcam.utilitarian.charstar.CharStarTest.consistentHashCodeWithString()
mutated return of Object value for io/earcam/utilitarian/charstar/CharSequences::charSequence to ( if (x != null) null else throw new RuntimeException ) → KILLED

62

1.1
Location : startsWith
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.startsWithIdentical()
changed conditional boundary → KILLED

2.2
Location : startsWith
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.startsWith()
negated conditional → KILLED

63

1.1
Location : startsWith
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.doesNotStartWithDifferentLength()
replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED

65

1.1
Location : startsWith
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.startsWith()
changed conditional boundary → KILLED

2.2
Location : startsWith
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.doesNotStartWit_()
negated conditional → KILLED

66

1.1
Location : startsWith
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.doesNotStartWith()
negated conditional → KILLED

67

1.1
Location : startsWith
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.doesNotStartWit_()
replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED

70

1.1
Location : startsWith
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.startsWith()
replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED

76

1.1
Location : endsWith
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.endsWithIdentical()
changed conditional boundary → KILLED

2.2
Location : endsWith
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.endsWith()
negated conditional → KILLED

77

1.1
Location : endsWith
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.doesNotEndWithDifferentLength()
replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED

79

1.1
Location : endsWith
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest._oesNotEndWith()
changed conditional boundary → KILLED

2.2
Location : endsWith
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.endsWith()
Changed increment from -1 to 1 → KILLED

3.3
Location : endsWith
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.endsWith()
Changed increment from -1 to 1 → KILLED

4.4
Location : endsWith
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.endsWith()
Replaced integer subtraction with addition → KILLED

5.5
Location : endsWith
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.endsWith()
Replaced integer subtraction with addition → KILLED

6.6
Location : endsWith
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.doesNotEndWit_()
negated conditional → KILLED

80

1.1
Location : endsWith
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.endsWith()
negated conditional → KILLED

81

1.1
Location : endsWith
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.doesNotEndWit_()
replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED

84

1.1
Location : endsWith
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.endsWith()
replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED

90

1.1
Location : same
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.notSameFirstIsNull()
negated conditional → KILLED

2.2
Location : same
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.notSameSecondIsNull()
negated conditional → KILLED

91

1.1
Location : same
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.notSameFirstIsNull()
negated conditional → KILLED

2.2
Location : same
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.notSameFirstIsNull()
replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED

93

1.1
Location : same
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.notSameDifferentLength()
negated conditional → KILLED

94

1.1
Location : same
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.notSameDifferentLength()
replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED

96

1.1
Location : same
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.same()
changed conditional boundary → KILLED

2.2
Location : same
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.notSame()
negated conditional → KILLED

97

1.1
Location : same
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.same()
negated conditional → KILLED

98

1.1
Location : same
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.notSame()
replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED

101

1.1
Location : same
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.same()
replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED

108

1.1
Location : hashCode
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.consistentHashCodeBetweenStringBuilderAndString()
changed conditional boundary → KILLED

2.2
Location : hashCode
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.consistentHashCodeBetweenStringBuilderAndString()
Changed increment from 1 to -1 → KILLED

3.3
Location : hashCode
Killed by : io.earcam.utilitarian.charstar.CharStarTest.consistentHashCodeWithString()
negated conditional → KILLED

109

1.1
Location : hashCode
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.consistentHashCodeBetweenStringBuilderAndString()
Replaced integer multiplication with division → KILLED

2.2
Location : hashCode
Killed by : io.earcam.utilitarian.charstar.CharStarTest.consistentHashCodeWithString()
Replaced integer addition with subtraction → KILLED

111

1.1
Location : hashCode
Killed by : io.earcam.utilitarian.charstar.CharStarTest.consistentHashCodeWithString()
replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED

119

1.1
Location : trim
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.nothingToTrim()
negated conditional → KILLED

120

1.1
Location : trim
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.trimBothEnds()
Changed increment from 1 to -1 → KILLED

122

1.1
Location : trim
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.nothingToTrim()
Replaced integer subtraction with addition → KILLED

2.2
Location : trim
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.nothingToTrim()
negated conditional → KILLED

123

1.1
Location : trim
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.trimBothEnds()
Changed increment from -1 to 1 → KILLED

125

1.1
Location : trim
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.nothingToTrim()
mutated return of Object value for io/earcam/utilitarian/charstar/CharSequences::trim to ( if (x != null) null else throw new RuntimeException ) → KILLED

131

1.1
Location : replace
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.replaceIsNullSafe()
negated conditional → KILLED

132

1.1
Location : replace
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.replaceIsNullSafe()
mutated return of Object value for io/earcam/utilitarian/charstar/CharSequences::replace to ( if (x != null) null else throw new RuntimeException ) → KILLED

135

1.1
Location : replace
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.replace()
changed conditional boundary → KILLED

2.2
Location : replace
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.replace()
negated conditional → KILLED

137

1.1
Location : replace
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.replace()
negated conditional → KILLED

141

1.1
Location : replace
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.replace()
mutated return of Object value for io/earcam/utilitarian/charstar/CharSequences::replace to ( if (x != null) null else throw new RuntimeException ) → KILLED

153

1.1
Location : isEmpty
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.nullIsEmpty()
negated conditional → KILLED

2.2
Location : isEmpty
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.zeroLengthStringIsEmpty()
negated conditional → KILLED

3.3
Location : isEmpty
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.nullIsEmpty()
replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED

166

1.1
Location : lastIndexOf
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.lastIndexOfFirst()
changed conditional boundary → KILLED

2.2
Location : lastIndexOf
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.lastIndexOf()
Changed increment from -1 to 1 → KILLED

3.3
Location : lastIndexOf
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.lastIndexOf()
Replaced integer subtraction with addition → KILLED

4.4
Location : lastIndexOf
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.lastIndexOf()
negated conditional → KILLED

167

1.1
Location : lastIndexOf
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.lastIndexOf()
negated conditional → KILLED

168

1.1
Location : lastIndexOf
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.lastIndexOf()
replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED

171

1.1
Location : lastIndexOf
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.lastIndexOfNotFound()
replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED

177

1.1
Location : indexOf
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.indexOfLast()
replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED

183

1.1
Location : indexOf
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.indexOfNotFound()
changed conditional boundary → KILLED

2.2
Location : indexOf
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.indexOfLast()
negated conditional → KILLED

184

1.1
Location : indexOf
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.indexOfLast()
negated conditional → KILLED

185

1.1
Location : indexOf
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.indexOfLast()
replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED

188

1.1
Location : indexOf
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.indexOfNotFound()
replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED

194

1.1
Location : toBytes
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.toBytes()
mutated return of Object value for io/earcam/utilitarian/charstar/CharSequences::toBytes to ( if (x != null) null else throw new RuntimeException ) → KILLED

203

1.1
Location : toBytes
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.toBytes()
mutated return of Object value for io/earcam/utilitarian/charstar/CharSequences::toBytes to ( if (x != null) null else throw new RuntimeException ) → KILLED

209

1.1
Location : comparator
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.comparator()
mutated return of Object value for io/earcam/utilitarian/charstar/CharSequences::comparator to ( if (x != null) null else throw new RuntimeException ) → KILLED

217

1.1
Location : compare
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.compareToEqual()
changed conditional boundary → KILLED

2.2
Location : compare
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.compareToGreaterThan()
negated conditional → KILLED

220

1.1
Location : compare
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.compareToGreaterThan()
negated conditional → KILLED

221

1.1
Location : compare
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.compareToLessThan()
Replaced integer subtraction with addition → KILLED

2.2
Location : compare
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.compareToGreaterThan()
replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED

223

1.1
Location : compare
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.compareToEqual()
Changed increment from 1 to -1 → KILLED

225

1.1
Location : compare
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.compareToEqual()
Replaced integer subtraction with addition → KILLED

2.2
Location : compare
Killed by : io.earcam.utilitarian.charstar.CharSequencesTest.compareToEqual()
replaced return of integer sized value with (x == 0 ? 1 : 0) → KILLED

232

1.1
Location : toArray
Killed by : io.earcam.utilitarian.charstar.CharStarTest.consistentHashCodeWithString()
changed conditional boundary → KILLED

2.2
Location : toArray
Killed by : io.earcam.utilitarian.charstar.CharStarTest.consistentHashCodeWithString()
negated conditional → KILLED

235

1.1
Location : toArray
Killed by : io.earcam.utilitarian.charstar.CharStarTest.consistentHashCodeWithString()
mutated return of Object value for io/earcam/utilitarian/charstar/CharSequences::toArray to ( if (x != null) null else throw new RuntimeException ) → KILLED

Active mutators

Tests examined


Report generated by PIT 1.4.3