diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2024-04-11 15:09:55 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2024-04-11 21:04:22 +0200 |
commit | 2d6bbe0b8bff09d105b77161c1d26a00ce43bf0c (patch) | |
tree | f9948a9904d837960887e81a956b29f92d918002 /predicate-search-core | |
parent | 6923743ed320ce339727ad57f6fc2da5f82f5e3f (diff) |
Unify on List.of
Diffstat (limited to 'predicate-search-core')
-rw-r--r-- | predicate-search-core/src/test/java/com/yahoo/document/predicate/FeatureConjunctionTest.java | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/predicate-search-core/src/test/java/com/yahoo/document/predicate/FeatureConjunctionTest.java b/predicate-search-core/src/test/java/com/yahoo/document/predicate/FeatureConjunctionTest.java index 38b8d668a18..35dab62925f 100644 --- a/predicate-search-core/src/test/java/com/yahoo/document/predicate/FeatureConjunctionTest.java +++ b/predicate-search-core/src/test/java/com/yahoo/document/predicate/FeatureConjunctionTest.java @@ -3,8 +3,7 @@ package com.yahoo.document.predicate; import org.junit.jupiter.api.Test; -import java.util.Arrays; -import java.util.Collections; +import java.util.List; import static com.yahoo.document.predicate.Predicates.feature; import static com.yahoo.document.predicate.Predicates.not; @@ -17,7 +16,7 @@ public class FeatureConjunctionTest { @Test void require_that_featureconjunction_with_valid_operands_can_be_constructed() { - new FeatureConjunction(Arrays.asList( + new FeatureConjunction(List.of( not(feature("a").inSet("1")), feature("b").inSet("1"))); } @@ -25,7 +24,7 @@ public class FeatureConjunctionTest { @Test void require_that_constructor_throws_exception_if_all_operands_are_not_featuresets() { assertThrows(IllegalArgumentException.class, () -> { - new FeatureConjunction(Arrays.asList( + new FeatureConjunction(List.of( not(feature("a").inSet("1")), feature("b").inRange(1, 2))); }); @@ -34,28 +33,28 @@ public class FeatureConjunctionTest { @Test void require_that_constructor_throws_exception_if_single_operand() { assertThrows(IllegalArgumentException.class, () -> { - new FeatureConjunction(Arrays.asList(feature("a").inSet("1"))); + new FeatureConjunction(List.of(feature("a").inSet("1"))); }); } @Test void require_that_constructor_throws_exception_if_no_operands() { assertThrows(IllegalArgumentException.class, () -> { - new FeatureConjunction(Collections.emptyList()); + new FeatureConjunction(List.of()); }); } @Test void require_that_contructor_throws_exception_if_featuresets_contain_multiple_values() { assertThrows(IllegalArgumentException.class, () -> { - new FeatureConjunction(Arrays.asList(feature("a").inSet("1"), feature("b").inSet("2", "3"))); + new FeatureConjunction(List.of(feature("a").inSet("1"), feature("b").inSet("2", "3"))); }); } @Test void require_that_constructor_throws_exception_if_featureset_keys_are_not_unique() { assertThrows(IllegalArgumentException.class, () -> { - new FeatureConjunction(Arrays.asList( + new FeatureConjunction(List.of( not(feature("a").inSet("1")), feature("a").inSet("2"))); }); |