SimilarRunVisitor.java

1
package pro.verron.officestamper.preset.preprocessors.similarrun;
2
3
import org.docx4j.utils.TraversalUtilVisitor;
4
import org.docx4j.wml.R;
5
import org.docx4j.wml.RPr;
6
7
import java.util.ArrayList;
8
import java.util.List;
9
import java.util.Objects;
10
11
public class SimilarRunVisitor
12
        extends TraversalUtilVisitor<R> {
13
14
    private final List<List<R>> similarStyleRuns = new ArrayList<>();
15
16
    public List<List<R>> getSimilarStyleRuns() {
17 1 1. getSimilarStyleRuns : replaced return value with Collections.emptyList for pro/verron/officestamper/preset/preprocessors/similarrun/SimilarRunVisitor::getSimilarStyleRuns → SURVIVED
        return similarStyleRuns;
18
    }
19
20
    @Override
21
    public void apply(R element, Object parent, List<Object> siblings) {
22
        RPr rPr = element.getRPr();
23
        int currentIndex = siblings.indexOf(element);
24
        List<R> similarStyleConcurrentRun = siblings
25
                .stream()
26
                .skip(currentIndex)
27 3 1. lambda$apply$0 : negated conditional → SURVIVED
2. lambda$apply$0 : negated conditional → SURVIVED
3. lambda$apply$0 : replaced boolean return with true for pro/verron/officestamper/preset/preprocessors/similarrun/SimilarRunVisitor::lambda$apply$0 → KILLED
                .takeWhile(o -> o instanceof R run && Objects.equals(run.getRPr(), rPr))
28
                .map(R.class::cast)
29
                .toList();
30
31 2 1. apply : changed conditional boundary → SURVIVED
2. apply : negated conditional → SURVIVED
        if (similarStyleConcurrentRun.size() > 1)
32
            similarStyleRuns.add(similarStyleConcurrentRun);
33
    }
34
}

Mutations

17

1.1
Location : getSimilarStyleRuns
Killed by : none
replaced return value with Collections.emptyList for pro/verron/officestamper/preset/preprocessors/similarrun/SimilarRunVisitor::getSimilarStyleRuns → SURVIVED
Covering tests

27

1.1
Location : lambda$apply$0
Killed by : pro.verron.officestamper.test.DefaultTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DefaultTests]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#4]
replaced boolean return with true for pro/verron/officestamper/preset/preprocessors/similarrun/SimilarRunVisitor::lambda$apply$0 → KILLED

2.2
Location : lambda$apply$0
Killed by : none
negated conditional → SURVIVED
Covering tests

3.3
Location : lambda$apply$0
Killed by : none
negated conditional → SURVIVED Covering tests

31

1.1
Location : apply
Killed by : none
changed conditional boundary → SURVIVED
Covering tests

2.2
Location : apply
Killed by : none
negated conditional → SURVIVED Covering tests

Active mutators

Tests examined


Report generated by PIT 1.17.1