ListHolder.java

1
package com.github.dakusui.pcond.fluent;
2
3
import java.util.ArrayList;
4
import java.util.Collection;
5
import java.util.List;
6
7
8
/**
9
 * A list that are not printed in a report created by {@link com.github.dakusui.pcond.validator.ReportComposer}.
10
 * An instance of this class should be used together with a statement created by {@link Statement#createPredicateForAllOf(Statement[])} method.
11
 *
12
 * @param <E> Type of elements in this list.
13
 * @see com.github.dakusui.pcond.validator.ReportComposer
14
 * @see Statement#createPredicateForAllOf(Statement[])
15
 */
16
public class ListHolder<E> extends ArrayList<E> implements ValueHolder {
17
  private ListHolder(Collection<E> collection) {
18
    this.addAll(collection);
19
  }
20
21
  /**
22
   * A method to create an instance of this class.
23
   *
24
   * @param list A list wrapped by the returned object.
25
   * @return An instance of {@link ListHolder} that wraps a given list.
26
   * @param <E> Type of elements in the passed and returned list.
27
   */
28
  public static <E> List<E> fromList(List<E> list) {
29 1 1. fromList : replaced return value with Collections.emptyList for com/github/dakusui/pcond/fluent/ListHolder::fromList → KILLED
    return new ListHolder<>(list);
30
  }
31
}

Mutations

29

1.1
Location : fromList
Killed by : com.github.dakusui.ut.thincrest.ut.styles.FluentStyleTestAssertionTest$ForTestAssertionsTest.assertAll_passed(com.github.dakusui.ut.thincrest.ut.styles.FluentStyleTestAssertionTest$ForTestAssertionsTest)
replaced return value with Collections.emptyList for com/github/dakusui/pcond/fluent/ListHolder::fromList → KILLED

Active mutators

Tests examined


Report generated by PIT 1.7.3