ContextPredicate.java

1
package com.github.dakusui.actionunit.core.context;
2
3
import com.github.dakusui.actionunit.core.Context;
4
import com.github.dakusui.printables.PrintablePredicate;
5
6
import java.util.Formatter;
7
import java.util.Objects;
8
import java.util.function.Predicate;
9
import java.util.function.Supplier;
10
11
import static com.github.dakusui.actionunit.utils.InternalUtils.toStringIfOverriddenOrNoname;
12
13
@FunctionalInterface
14
public interface ContextPredicate extends Predicate<Context>, Printable {
15
  @Override
16
  default void formatTo(Formatter formatter, int flags, int width, int precision) {
17
    formatter.format(toStringIfOverriddenOrNoname(this));
18
  }
19
20
  @Override
21
  default ContextPredicate and(Predicate<? super Context> other) {
22
    Objects.requireNonNull(other);
23 4 1. and : replaced return value with null for com/github/dakusui/actionunit/core/context/ContextPredicate::and → NO_COVERAGE
2. lambda$and$0 : negated conditional → NO_COVERAGE
3. lambda$and$0 : negated conditional → NO_COVERAGE
4. lambda$and$0 : replaced boolean return with true for com/github/dakusui/actionunit/core/context/ContextPredicate::lambda$and$0 → NO_COVERAGE
    return (t) -> test(t) && other.test(t);
24
  }
25
26
  @Override
27
  default ContextPredicate negate() {
28 3 1. lambda$negate$1 : negated conditional → NO_COVERAGE
2. lambda$negate$1 : replaced boolean return with true for com/github/dakusui/actionunit/core/context/ContextPredicate::lambda$negate$1 → NO_COVERAGE
3. negate : replaced return value with null for com/github/dakusui/actionunit/core/context/ContextPredicate::negate → NO_COVERAGE
    return (t) -> !test(t);
29
  }
30
31
  @Override
32
  default ContextPredicate or(Predicate<? super Context> other) {
33
    Objects.requireNonNull(other);
34 4 1. lambda$or$2 : negated conditional → NO_COVERAGE
2. lambda$or$2 : negated conditional → NO_COVERAGE
3. lambda$or$2 : replaced boolean return with true for com/github/dakusui/actionunit/core/context/ContextPredicate::lambda$or$2 → NO_COVERAGE
4. or : replaced return value with null for com/github/dakusui/actionunit/core/context/ContextPredicate::or → NO_COVERAGE
    return (t) -> test(t) || other.test(t);
35
  }
36
37
  class Impl extends PrintablePredicate<Context> implements ContextPredicate {
38
39
    public Impl(Supplier<String> formatter, Predicate<Context> predicate) {
40
      super(formatter, predicate);
41
    }
42
43
    @Override
44
    public ContextPredicate and(Predicate<? super Context> other) {
45 1 1. and : replaced return value with null for com/github/dakusui/actionunit/core/context/ContextPredicate$Impl::and → KILLED
      return (ContextPredicate) super.and(other);
46
    }
47
48
    @Override
49
    public ContextPredicate negate() {
50 1 1. negate : replaced return value with null for com/github/dakusui/actionunit/core/context/ContextPredicate$Impl::negate → KILLED
      return (ContextPredicate) super.negate();
51
    }
52
53
    @Override
54
    public ContextPredicate or(Predicate<? super Context> other) {
55 1 1. or : replaced return value with null for com/github/dakusui/actionunit/core/context/ContextPredicate$Impl::or → KILLED
      return (ContextPredicate) super.or(other);
56
    }
57
58
    @SuppressWarnings("unchecked")
59
    @Override
60
    protected ContextPredicate.Impl createPredicate(
61
        Supplier<String> formatter,
62
        Predicate<? super Context> predicate) {
63 1 1. createPredicate : replaced return value with null for com/github/dakusui/actionunit/core/context/ContextPredicate$Impl::createPredicate → KILLED
      return new ContextPredicate.Impl(formatter, (Predicate<Context>) predicate);
64
    }
65
  }
66
}

Mutations

23

1.1
Location : and
Killed by : none
replaced return value with null for com/github/dakusui/actionunit/core/context/ContextPredicate::and → NO_COVERAGE

2.2
Location : lambda$and$0
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location : lambda$and$0
Killed by : none
negated conditional → NO_COVERAGE

4.4
Location : lambda$and$0
Killed by : none
replaced boolean return with true for com/github/dakusui/actionunit/core/context/ContextPredicate::lambda$and$0 → NO_COVERAGE

28

1.1
Location : lambda$negate$1
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : lambda$negate$1
Killed by : none
replaced boolean return with true for com/github/dakusui/actionunit/core/context/ContextPredicate::lambda$negate$1 → NO_COVERAGE

3.3
Location : negate
Killed by : none
replaced return value with null for com/github/dakusui/actionunit/core/context/ContextPredicate::negate → NO_COVERAGE

34

1.1
Location : lambda$or$2
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : lambda$or$2
Killed by : none
negated conditional → NO_COVERAGE

3.3
Location : lambda$or$2
Killed by : none
replaced boolean return with true for com/github/dakusui/actionunit/core/context/ContextPredicate::lambda$or$2 → NO_COVERAGE

4.4
Location : or
Killed by : none
replaced return value with null for com/github/dakusui/actionunit/core/context/ContextPredicate::or → NO_COVERAGE

45

1.1
Location : and
Killed by : com.github.dakusui.actionunit.ut.ContextFunctionsUnitTest$GivenPrintablePredicate.whenPrinted$thenFormattedCorrectly(com.github.dakusui.actionunit.ut.ContextFunctionsUnitTest$GivenPrintablePredicate)
replaced return value with null for com/github/dakusui/actionunit/core/context/ContextPredicate$Impl::and → KILLED

50

1.1
Location : negate
Killed by : com.github.dakusui.actionunit.ut.ContextFunctionsUnitTest$GivenPrintablePredicate.whenPrinted$thenFormattedCorrectly(com.github.dakusui.actionunit.ut.ContextFunctionsUnitTest$GivenPrintablePredicate)
replaced return value with null for com/github/dakusui/actionunit/core/context/ContextPredicate$Impl::negate → KILLED

55

1.1
Location : or
Killed by : com.github.dakusui.actionunit.ut.ContextFunctionsUnitTest$GivenPrintablePredicate.whenPrinted$thenFormattedCorrectly(com.github.dakusui.actionunit.ut.ContextFunctionsUnitTest$GivenPrintablePredicate)
replaced return value with null for com/github/dakusui/actionunit/core/context/ContextPredicate$Impl::or → KILLED

63

1.1
Location : createPredicate
Killed by : com.github.dakusui.actionunit.ut.ContextFunctionsUnitTest$GivenPrintablePredicate.whenPrinted$thenFormattedCorrectly(com.github.dakusui.actionunit.ut.ContextFunctionsUnitTest$GivenPrintablePredicate)
replaced return value with null for com/github/dakusui/actionunit/core/context/ContextPredicate$Impl::createPredicate → KILLED

Active mutators

Tests examined


Report generated by PIT 1.7.3