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