BooleanChecker.java

1
package com.github.valid8j.pcond.core.fluent.builtins;
2
3
import com.github.valid8j.pcond.core.fluent.AbstractObjectChecker;
4
import com.github.valid8j.pcond.forms.Predicates;
5
import com.github.valid8j.pcond.internals.InternalUtils;
6
7
import java.util.function.Function;
8
import java.util.function.Predicate;
9
import java.util.function.Supplier;
10
11
import static java.util.Objects.requireNonNull;
12
13
public interface BooleanChecker<T> extends
14
    AbstractObjectChecker<
15
                    BooleanChecker<T>,
16
                    T,
17
                    Boolean> {
18
19
  default BooleanChecker<T> trueValue() {
20 1 1. trueValue : replaced return value with null for com/github/valid8j/pcond/core/fluent/builtins/BooleanChecker::trueValue → KILLED
    return this.checkWithPredicate(Predicates.isTrue());
21
  }
22
23
  default BooleanChecker<T> falseValue() {
24 1 1. falseValue : replaced return value with null for com/github/valid8j/pcond/core/fluent/builtins/BooleanChecker::falseValue → KILLED
    return this.checkWithPredicate(Predicates.isFalse());
25
  }
26
27
  @SuppressWarnings("unchecked")
28
  default BooleanChecker<T> check(Function<BooleanChecker<Boolean>, Predicate<Boolean>> phrase) {
29
    requireNonNull(phrase);
30 2 1. check : replaced return value with null for com/github/valid8j/pcond/core/fluent/builtins/BooleanChecker::check → KILLED
2. lambda$check$0 : replaced return value with null for com/github/valid8j/pcond/core/fluent/builtins/BooleanChecker::lambda$check$0 → KILLED
    return this.addCheckPhrase(v -> phrase.apply((BooleanChecker<Boolean>) v));
31
  }
32
  class Impl<T> extends
33
      Base<
34
          BooleanChecker<T>,
35
          T,
36
          Boolean> implements
37
      BooleanChecker<T> {
38
    public Impl(Supplier<T> baseValue, Function<T, Boolean> transformingFunction) {
39
      super(baseValue, transformingFunction);
40
    }
41
42
    @Override
43
    protected BooleanChecker<Boolean> rebase() {
44 1 1. rebase : replaced return value with null for com/github/valid8j/pcond/core/fluent/builtins/BooleanChecker$Impl::rebase → KILLED
      return new Impl<>(this::value, InternalUtils.trivialIdentityFunction());
45
    }
46
  }
47
}

Mutations

20

1.1
Location : trueValue
Killed by : com.github.valid8j.ut.styles.fluent.FluentBooleanTest.givenTrue_whenIsTrue_thenPass(com.github.valid8j.ut.styles.fluent.FluentBooleanTest)
replaced return value with null for com/github/valid8j/pcond/core/fluent/builtins/BooleanChecker::trueValue → KILLED

24

1.1
Location : falseValue
Killed by : com.github.valid8j.ut.styles.MoreFluentListTest.test_isEmpty(com.github.valid8j.ut.styles.MoreFluentListTest)
replaced return value with null for com/github/valid8j/pcond/core/fluent/builtins/BooleanChecker::falseValue → KILLED

30

1.1
Location : check
Killed by : com.github.valid8j.ut.styles.fluent.FluentBooleanTest.givenFalse_whenCheckIsTrue_thenComparisonFailure(com.github.valid8j.ut.styles.fluent.FluentBooleanTest)
replaced return value with null for com/github/valid8j/pcond/core/fluent/builtins/BooleanChecker::check → KILLED

2.2
Location : lambda$check$0
Killed by : com.github.valid8j.ut.styles.fluent.FluentBooleanTest.givenFalse_whenCheckIsTrue_thenComparisonFailure(com.github.valid8j.ut.styles.fluent.FluentBooleanTest)
replaced return value with null for com/github/valid8j/pcond/core/fluent/builtins/BooleanChecker::lambda$check$0 → KILLED

44

1.1
Location : rebase
Killed by : com.github.valid8j.ut.styles.fluent.FluentBooleanTest.givenFalse_whenCheckIsTrue_thenComparisonFailure(com.github.valid8j.ut.styles.fluent.FluentBooleanTest)
replaced return value with null for com/github/valid8j/pcond/core/fluent/builtins/BooleanChecker$Impl::rebase → KILLED

Active mutators

Tests examined


Report generated by PIT 1.7.3