From dbebced54f4779c15d5da548e1d589d262b67170 Mon Sep 17 00:00:00 2001
From: Nat Pryce
* A matcher over acceptable values.
* A matcher is able to describe itself to give feedback when it fails.
- *
* Matcher implementations should NOT directly implement this interface. * Instead, extend the {@link BaseMatcher} abstract class, * which will ensure that the Matcher API can grow to support * new features and remain compatible with all Matcher implementations. - *
+ * + ** For easy access to common Matcher implementations, use the static factory * methods in {@link CoreMatchers}. - *
+ * + ** N.B. Well designed matchers should be immutable. - * + *
+ * * @see CoreMatchers * @see BaseMatcher */ @@ -23,7 +28,7 @@ public interface Matcher* Matcher<String> aNonEmptyString = new CustomMatcher<String>("a non empty string") { * public boolean matches(Object object) { - * return ((object instanceof String) && !((String) object).isEmpty(); + * return ((object instanceof String) && !((String) object).isEmpty(); * } * }; *diff --git a/hamcrest-core/src/main/java/org/hamcrest/core/AllOf.java b/hamcrest-core/src/main/java/org/hamcrest/core/AllOf.java index a5daf943..55c37129 100644 --- a/hamcrest-core/src/main/java/org/hamcrest/core/AllOf.java +++ b/hamcrest-core/src/main/java/org/hamcrest/core/AllOf.java @@ -40,7 +40,6 @@ public void describeTo(Description description) { /** * Creates a matcher that matches if the examined object matches ALL of the specified matchers. - * * For example: *
assertThat("myValue", allOf(startsWith("my"), containsString("Val")))*/ @@ -51,7 +50,6 @@ public static
assertThat("myValue", allOf(startsWith("my"), containsString("Val")))*/ @@ -62,7 +60,6 @@ public static
assertThat("myValue", allOf(startsWith("my"), containsString("Val")))*/ @@ -76,7 +73,6 @@ public static
assertThat("myValue", allOf(startsWith("my"), containsString("Val")))*/ @@ -91,7 +87,6 @@ public static
assertThat("myValue", allOf(startsWith("my"), containsString("Val")))*/ @@ -107,7 +102,6 @@ public static
assertThat("myValue", allOf(startsWith("my"), containsString("Val")))*/ @@ -124,7 +118,6 @@ public static
assertThat("myValue", allOf(startsWith("my"), containsString("Val")))*/ diff --git a/hamcrest-core/src/main/java/org/hamcrest/core/AnyOf.java b/hamcrest-core/src/main/java/org/hamcrest/core/AnyOf.java index de006776..f6652290 100644 --- a/hamcrest-core/src/main/java/org/hamcrest/core/AnyOf.java +++ b/hamcrest-core/src/main/java/org/hamcrest/core/AnyOf.java @@ -30,7 +30,6 @@ public void describeTo(Description description) { /** * Creates a matcher that matches if the examined object matches ANY of the specified matchers. - * * For example: *
assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))*/ @@ -41,7 +40,6 @@ public static
assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))*/ @@ -52,7 +50,6 @@ public static
assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))*/ @@ -66,7 +63,6 @@ public static
assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))*/ @@ -81,7 +77,6 @@ public static
assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))*/ @@ -97,7 +92,6 @@ public static
assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))*/ @@ -114,7 +108,6 @@ public static
assertThat("myValue", anyOf(startsWith("foo"), containsString("Val")))*/ diff --git a/hamcrest-core/src/main/java/org/hamcrest/core/CombinableMatcher.java b/hamcrest-core/src/main/java/org/hamcrest/core/CombinableMatcher.java index 8d4e6f30..e3bcbd8c 100644 --- a/hamcrest-core/src/main/java/org/hamcrest/core/CombinableMatcher.java +++ b/hamcrest-core/src/main/java/org/hamcrest/core/CombinableMatcher.java @@ -42,7 +42,6 @@ private ArrayList
assertThat("fab", both(containsString("a")).and(containsString("b")))*/ @@ -63,7 +62,6 @@ public CombinableMatcher
assertThat("fan", either(containsString("a")).or(containsString("b")))*/ @@ -81,4 +79,4 @@ public CombinableMatcher
describedAs("a big decimal equal to %0", equalTo(myBigDecimal), myBigDecimal.toPlainString())* diff --git a/hamcrest-core/src/main/java/org/hamcrest/core/Every.java b/hamcrest-core/src/main/java/org/hamcrest/core/Every.java index f6e0fbac..45503b0d 100644 --- a/hamcrest-core/src/main/java/org/hamcrest/core/Every.java +++ b/hamcrest-core/src/main/java/org/hamcrest/core/Every.java @@ -33,7 +33,6 @@ public void describeTo(Description description) { * Creates a matcher for {@link Iterable}s that only matches when a single pass over the * examined {@link Iterable} yields items that are all matched by the specified *
itemMatcher
.
- *
* For example:
* assertThat(Arrays.asList("bar", "baz"), everyItem(startsWith("ba")))* diff --git a/hamcrest-core/src/main/java/org/hamcrest/core/Is.java b/hamcrest-core/src/main/java/org/hamcrest/core/Is.java index d0aaa966..2dfec24d 100644 --- a/hamcrest-core/src/main/java/org/hamcrest/core/Is.java +++ b/hamcrest-core/src/main/java/org/hamcrest/core/Is.java @@ -40,7 +40,6 @@ public void describeMismatch(Object item, Description mismatchDescription) { /** * Decorates another Matcher, retaining its behaviour, but allowing tests * to be slightly more expressive. - * * For example: *
assertThat(cheese, is(equalTo(smelly)))* instead of: @@ -54,7 +53,6 @@ public static
is(equalTo(x))
.
- *
* For example:
* assertThat(cheese, is(smelly))* instead of: @@ -68,7 +66,6 @@ public static
is(instanceOf(SomeClass.class))
.
- *
* For example:
* assertThat(cheese, isA(Cheddar.class))* instead of: diff --git a/hamcrest-core/src/main/java/org/hamcrest/core/IsCollectionContaining.java b/hamcrest-core/src/main/java/org/hamcrest/core/IsCollectionContaining.java index 1f9ba4fa..e4bf6170 100644 --- a/hamcrest-core/src/main/java/org/hamcrest/core/IsCollectionContaining.java +++ b/hamcrest-core/src/main/java/org/hamcrest/core/IsCollectionContaining.java @@ -61,7 +61,6 @@ public void describeTo(Description description) { * examined {@link Iterable} yields at least one item that is matched by the specified *
itemMatcher
. Whilst matching, the traversal of the examined {@link Iterable}
* will stop as soon as a matching item is found.
- *
* For example:
* assertThat(Arrays.asList("foo", "bar"), hasItem(startsWith("ba")))* @@ -78,7 +77,6 @@ public static
item
. Whilst matching, the traversal of the examined {@link Iterable}
* will stop as soon as a matching item is found.
- *
* For example:
* assertThat(Arrays.asList("foo", "bar"), hasItem("bar"))* @@ -96,7 +94,6 @@ public static
itemMatchers
. Whilst matching, each traversal of
* the examined {@link Iterable} will stop as soon as a matching item is found.
- *
* For example:
* assertThat(Arrays.asList("foo", "bar", "baz"), hasItems(endsWith("z"), endsWith("o")))* @@ -120,7 +117,6 @@ public static
items
. Whilst matching, each traversal of the
* examined {@link Iterable} will stop as soon as a matching item is found.
- *
* For example:
* assertThat(Arrays.asList("foo", "bar", "baz"), hasItems("baz", "foo"))* diff --git a/hamcrest-core/src/main/java/org/hamcrest/core/IsEqual.java b/hamcrest-core/src/main/java/org/hamcrest/core/IsEqual.java index 1ddc9a3a..84060097 100644 --- a/hamcrest-core/src/main/java/org/hamcrest/core/IsEqual.java +++ b/hamcrest-core/src/main/java/org/hamcrest/core/IsEqual.java @@ -79,7 +79,6 @@ private static boolean isArray(Object o) { * it will match if both the operand and the examined object are arrays of the same length and * contain items that are equal to each other (according to the above rules) in the same * indexes. - * * For example: *
* assertThat("foo", equalTo("foo")); diff --git a/hamcrest-core/src/main/java/org/hamcrest/core/IsInstanceOf.java b/hamcrest-core/src/main/java/org/hamcrest/core/IsInstanceOf.java index a1fdf368..14eab599 100644 --- a/hamcrest-core/src/main/java/org/hamcrest/core/IsInstanceOf.java +++ b/hamcrest-core/src/main/java/org/hamcrest/core/IsInstanceOf.java @@ -65,8 +65,7 @@ public void describeTo(Description description) { * the examined object. * ** - * If an exception is thrown by the getter method for a property, the property + *The created matcher assumes no relationship between specified type and the examined object.
- * - * For example: + * For example: *assertThat(new Canoe(), instanceOf(Paddlable.class));* */ @@ -84,8 +83,7 @@ public staticMatcher instanceOf(Class> type) { * The created matcher forces a relationship between specified type and the examined object, and should be * used when it is necessary to make generics conform, for example in the JMock clause *
- * - * For example: + * For example: *with(any(Thing.class))
assertThat(new Canoe(), instanceOf(Canoe.class));* */ diff --git a/hamcrest-core/src/main/java/org/hamcrest/core/IsNot.java b/hamcrest-core/src/main/java/org/hamcrest/core/IsNot.java index 39d19892..a8995dab 100644 --- a/hamcrest-core/src/main/java/org/hamcrest/core/IsNot.java +++ b/hamcrest-core/src/main/java/org/hamcrest/core/IsNot.java @@ -34,7 +34,6 @@ public void describeTo(Description description) { /** * Creates a matcher that wraps an existing matcher, but inverts the logic by which * it will match. - * * For example: *assertThat(cheese, is(not(equalTo(smelly))))* @@ -48,7 +47,6 @@ public staticMatcher not(Matcher matcher) { /** * A shortcut to the frequently used not(equalTo(x))
. - * * For example: *assertThat(cheese, is(not(smelly)))* instead of: diff --git a/hamcrest-core/src/main/java/org/hamcrest/core/IsNull.java b/hamcrest-core/src/main/java/org/hamcrest/core/IsNull.java index 6666ef90..8c7ace8f 100644 --- a/hamcrest-core/src/main/java/org/hamcrest/core/IsNull.java +++ b/hamcrest-core/src/main/java/org/hamcrest/core/IsNull.java @@ -24,7 +24,6 @@ public void describeTo(Description description) { /** * Creates a matcher that matches if examined object isnull
. - * * For example: *assertThat(cheese, is(nullValue())* @@ -36,7 +35,6 @@ public static Matcher
If an exception is thrown by the getter method for a property, the property * does not exist, is not readable, or a reflection related exception is thrown * when trying to invoke it then this is treated as an evaluation failure and * the matches method will return false. - *
- * This matcher class will also work with JavaBean objects that have explicit + * + *This matcher class will also work with JavaBean objects that have explicit * bean descriptions via an associated BeanInfo description class. See the * JavaBeans specification for more information: - *
* http://java.sun.com/products/javabeans/docs/index.html + * * * @author Iain McGinniss * @author Nat Pryce @@ -136,7 +137,6 @@ public ConditionassertThat(myBean, hasProperty("foo", equalTo("bar"))* diff --git a/hamcrest-library/src/main/java/org/hamcrest/beans/PropertyUtil.java b/hamcrest-library/src/main/java/org/hamcrest/beans/PropertyUtil.java index 3dd12e8c..8029dbbb 100644 --- a/hamcrest-library/src/main/java/org/hamcrest/beans/PropertyUtil.java +++ b/hamcrest-library/src/main/java/org/hamcrest/beans/PropertyUtil.java @@ -8,7 +8,6 @@ /** * Utility class for accessing properties on JavaBean objects. - * * See http://java.sun.com/products/javabeans/docs/index.html for * more information on JavaBeans. * diff --git a/hamcrest-library/src/main/java/org/hamcrest/beans/SamePropertyValuesAs.java b/hamcrest-library/src/main/java/org/hamcrest/beans/SamePropertyValuesAs.java index bade84c4..c82fd696 100644 --- a/hamcrest-library/src/main/java/org/hamcrest/beans/SamePropertyValuesAs.java +++ b/hamcrest-library/src/main/java/org/hamcrest/beans/SamePropertyValuesAs.java @@ -124,7 +124,6 @@ private static Object readProperty(Method method, Object target) { * Creates a matcher that matches when the examined object has values for all of * its JavaBean properties that are equal to the corresponding values of the * specified bean. - * * For example: *
assertThat(myBean, samePropertyValuesAs(myExpectedBean))* diff --git a/hamcrest-library/src/main/java/org/hamcrest/collection/IsArray.java b/hamcrest-library/src/main/java/org/hamcrest/collection/IsArray.java index 0e7eeddc..e0e27ec6 100644 --- a/hamcrest-library/src/main/java/org/hamcrest/collection/IsArray.java +++ b/hamcrest-library/src/main/java/org/hamcrest/collection/IsArray.java @@ -84,7 +84,6 @@ protected String descriptionEnd() { * Creates a matcher that matches arrays whose elements are satisfied by the specified matchers. Matches * positively only if the number of matchers specified is equal to the length of the examined array and * each matcher[i] is satisfied by array[i]. - * * For example: *
assertThat(new Integer[]{1,2,3}, is(array(equalTo(1), equalTo(2), equalTo(3))))* diff --git a/hamcrest-library/src/main/java/org/hamcrest/collection/IsArrayContaining.java b/hamcrest-library/src/main/java/org/hamcrest/collection/IsArrayContaining.java index ee17b410..fc61d9c5 100644 --- a/hamcrest-library/src/main/java/org/hamcrest/collection/IsArrayContaining.java +++ b/hamcrest-library/src/main/java/org/hamcrest/collection/IsArrayContaining.java @@ -44,7 +44,6 @@ public void describeTo(Description description) { * Creates a matcher for arrays that matches when the examined array contains at least one item * that is matched by the specified
elementMatcher
. Whilst matching, the traversal
* of the examined array will stop as soon as a matching element is found.
- *
* For example:
* assertThat(new String[] {"foo", "bar"}, hasItemInArray(startsWith("ba")))* @@ -58,7 +57,6 @@ public static
hasItemInArray(equalTo(x))
.
- *
* For example:
* assertThat(hasItemInArray(x))* instead of: diff --git a/hamcrest-library/src/main/java/org/hamcrest/collection/IsArrayContainingInAnyOrder.java b/hamcrest-library/src/main/java/org/hamcrest/collection/IsArrayContainingInAnyOrder.java index d4e01f00..07224405 100644 --- a/hamcrest-library/src/main/java/org/hamcrest/collection/IsArrayContainingInAnyOrder.java +++ b/hamcrest-library/src/main/java/org/hamcrest/collection/IsArrayContainingInAnyOrder.java @@ -38,16 +38,20 @@ public void describeTo(Description description) { } /** + *
* Creates an order agnostic matcher for arrays that matches when each item in the * examined array satisfies one matcher anywhere in the specified matchers. * For a positive match, the examined array must be of the same length as the number of * specified matchers. - *
+ * + ** N.B. each of the specified matchers will only be used once during a given examination, so be * careful when specifying matchers that may be satisfied by more than one entry in an examined * array. + *
** For example: + *
*assertThat(new String[]{"foo", "bar"}, arrayContainingInAnyOrder(equalTo("bar"), equalTo("foo")))* * @param itemMatchers @@ -59,16 +63,20 @@ public static
* Creates an order agnostic matcher for arrays that matches when each item in the * examined array satisfies one matcher anywhere in the specified collection of matchers. * For a positive match, the examined array must be of the same length as the specified collection * of matchers. - *
+ * + ** N.B. each matcher in the specified collection will only be used once during a given * examination, so be careful when specifying matchers that may be satisfied by more than * one entry in an examined array. + *
** For example: + *
*assertThat(new String[]{"foo", "bar"}, arrayContainingInAnyOrder(Arrays.asList(equalTo("bar"), equalTo("foo"))))* * @param itemMatchers @@ -80,16 +88,18 @@ public static
N.B. each of the specified items will only be used once during a given examination, so be * careful when specifying items that may be equal to more than one entry in an examined * array. + *
** For example: + *
*assertThat(new String[]{"foo", "bar"}, containsInAnyOrder("bar", "foo"))* * @param items diff --git a/hamcrest-library/src/main/java/org/hamcrest/collection/IsArrayContainingInOrder.java b/hamcrest-library/src/main/java/org/hamcrest/collection/IsArrayContainingInOrder.java index 6611b304..73ad58f2 100644 --- a/hamcrest-library/src/main/java/org/hamcrest/collection/IsArrayContainingInOrder.java +++ b/hamcrest-library/src/main/java/org/hamcrest/collection/IsArrayContainingInOrder.java @@ -4,7 +4,7 @@ import org.hamcrest.Factory; import org.hamcrest.Matcher; import org.hamcrest.TypeSafeMatcher; -import org.hamcrest.core.IsNull; +import org.hamcrest.internal.NullSafety; import java.util.ArrayList; import java.util.Collection; @@ -41,7 +41,6 @@ public void describeTo(Description description) { * Creates a matcher for arrays that matches when each item in the examined array is * logically equal to the corresponding item in the specified items. For a positive match, * the examined array must be of the same length as the number of specified items. - * * For example: *
assertThat(new String[]{"foo", "bar"}, contains("foo", "bar"))* @@ -61,7 +60,6 @@ public static
assertThat(new String[]{"foo", "bar"}, contains(equalTo("foo"), equalTo("bar")))* @@ -70,7 +68,10 @@ public static
assertThat(new String[]{"foo", "bar"}, contains(Arrays.asList(equalTo("foo"), equalTo("bar"))))* @@ -90,12 +90,4 @@ public static
length
of the array
* satisfies the specified matcher.
- *
* For example:
* assertThat(new String[]{"foo", "bar"}, arrayWithSize(equalTo(2)))* @@ -38,7 +37,6 @@ public static
length
of the array
* equals the specified size
.
- *
* For example:
* assertThat(new String[]{"foo", "bar"}, arrayWithSize(2))* @@ -53,7 +51,6 @@ public static
length
of the array
* is zero.
- *
* For example:
* assertThat(new String[0], emptyArray())* diff --git a/hamcrest-library/src/main/java/org/hamcrest/collection/IsCollectionWithSize.java b/hamcrest-library/src/main/java/org/hamcrest/collection/IsCollectionWithSize.java index 7d4b508a..6682dccc 100644 --- a/hamcrest-library/src/main/java/org/hamcrest/collection/IsCollectionWithSize.java +++ b/hamcrest-library/src/main/java/org/hamcrest/collection/IsCollectionWithSize.java @@ -23,7 +23,6 @@ protected Integer featureValueOf(Collection extends E> actual) { /** * Creates a matcher for {@link java.util.Collection}s that matches when the
size()
method returns
* a value that satisfies the specified matcher.
- *
* For example:
* assertThat(Arrays.asList("foo", "bar"), hasSize(equalTo(2)))* @@ -38,7 +37,6 @@ public static
size()
method returns
* a value equal to the specified size
.
- *
* For example:
* assertThat(Arrays.asList("foo", "bar"), hasSize(2))* diff --git a/hamcrest-library/src/main/java/org/hamcrest/collection/IsEmptyCollection.java b/hamcrest-library/src/main/java/org/hamcrest/collection/IsEmptyCollection.java index 4544d9b8..c95ef31c 100644 --- a/hamcrest-library/src/main/java/org/hamcrest/collection/IsEmptyCollection.java +++ b/hamcrest-library/src/main/java/org/hamcrest/collection/IsEmptyCollection.java @@ -30,7 +30,6 @@ public void describeTo(Description description) { /** * Creates a matcher for {@link java.util.Collection}s matching examined collections whose
isEmpty
* method returns true
.
- *
* For example:
* assertThat(new ArrayList<String>(), is(empty()))* @@ -43,7 +42,6 @@ public static
isEmpty
* method returns true
.
- *
* For example:
* assertThat(new ArrayList<String>(), is(emptyCollectionOf(String.class)))* diff --git a/hamcrest-library/src/main/java/org/hamcrest/collection/IsEmptyIterable.java b/hamcrest-library/src/main/java/org/hamcrest/collection/IsEmptyIterable.java index 28c41299..133655bd 100644 --- a/hamcrest-library/src/main/java/org/hamcrest/collection/IsEmptyIterable.java +++ b/hamcrest-library/src/main/java/org/hamcrest/collection/IsEmptyIterable.java @@ -26,7 +26,6 @@ public void describeTo(Description description) { /** * Creates a matcher for {@link Iterable}s matching examined iterables that yield no items. - * * For example: *
assertThat(new ArrayList<String>(), is(emptyIterable()))* @@ -38,7 +37,6 @@ public static
assertThat(new ArrayList<String>(), is(emptyIterableOf(String.class)))* diff --git a/hamcrest-library/src/main/java/org/hamcrest/collection/IsIn.java b/hamcrest-library/src/main/java/org/hamcrest/collection/IsIn.java index 6d465532..5ffda432 100644 --- a/hamcrest-library/src/main/java/org/hamcrest/collection/IsIn.java +++ b/hamcrest-library/src/main/java/org/hamcrest/collection/IsIn.java @@ -34,7 +34,6 @@ public void describeTo(Description buffer) { /** * Creates a matcher that matches when the examined object is found within the * specified collection. - * * For example: *
assertThat("foo", isIn(Arrays.asList("bar", "foo")))* @@ -53,7 +52,6 @@ public static
assertThat("foo", is(in(Arrays.asList("bar", "foo"))))* @@ -69,7 +67,6 @@ public static
assertThat("foo", isIn(new String[]{"bar", "foo"}))* @@ -88,7 +85,6 @@ public static
assertThat("foo", is(in(new String[]{"bar", "foo"})))* @@ -104,7 +100,6 @@ public static
assertThat("foo", isOneOf("bar", "foo"))* @@ -123,7 +118,6 @@ public static
assertThat("foo", is(oneOf("bar", "foo")))* diff --git a/hamcrest-library/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java b/hamcrest-library/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java index cb6ab78e..16f473a6 100644 --- a/hamcrest-library/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java +++ b/hamcrest-library/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java @@ -78,16 +78,20 @@ private boolean isMatched(S item) { } /** + *
* Creates an order agnostic matcher for {@link Iterable}s that matches when a single pass over * the examined {@link Iterable} yields a series of items, each satisfying one matcher anywhere * in the specified matchers. For a positive match, the examined iterable must be of the same * length as the number of specified matchers. - *
+ * + ** N.B. each of the specified matchers will only be used once during a given examination, so be * careful when specifying matchers that may be satisfied by more than one entry in an examined * iterable. - *
+ * + ** For example: + *
*assertThat(Arrays.asList("foo", "bar"), containsInAnyOrder(equalTo("bar"), equalTo("foo")))* * @param itemMatchers @@ -99,16 +103,20 @@ public static
* Creates an order agnostic matcher for {@link Iterable}s that matches when a single pass over * the examined {@link Iterable} yields a series of items, each logically equal to one item * anywhere in the specified items. For a positive match, the examined iterable * must be of the same length as the number of specified items. - *
+ * + ** N.B. each of the specified items will only be used once during a given examination, so be * careful when specifying items that may be equal to more than one entry in an examined * iterable. - *
+ * + ** For example: + *
*assertThat(Arrays.asList("foo", "bar"), containsInAnyOrder("bar", "foo"))* * @param items @@ -125,16 +133,18 @@ public static
* Creates an order agnostic matcher for {@link Iterable}s that matches when a single pass over * the examined {@link Iterable} yields a series of items, each satisfying one matcher anywhere * in the specified collection of matchers. For a positive match, the examined iterable * must be of the same length as the specified collection of matchers. - *
+ * + ** N.B. each matcher in the specified collection will only be used once during a given * examination, so be careful when specifying matchers that may be satisfied by more than * one entry in an examined iterable. - *
- * For example: + * + *For example:
*assertThat(Arrays.asList("foo", "bar"), containsInAnyOrder(Arrays.asList(equalTo("bar"), equalTo("foo"))))* * @param itemMatchers diff --git a/hamcrest-library/src/main/java/org/hamcrest/collection/IsIterableContainingInOrder.java b/hamcrest-library/src/main/java/org/hamcrest/collection/IsIterableContainingInOrder.java index 164bc914..f14a5a82 100644 --- a/hamcrest-library/src/main/java/org/hamcrest/collection/IsIterableContainingInOrder.java +++ b/hamcrest-library/src/main/java/org/hamcrest/collection/IsIterableContainingInOrder.java @@ -5,12 +5,14 @@ import org.hamcrest.Matcher; import org.hamcrest.TypeSafeDiagnosingMatcher; import org.hamcrest.core.IsNull; +import org.hamcrest.internal.NullSafety; import java.util.ArrayList; import java.util.List; import static java.util.Arrays.asList; import static org.hamcrest.core.IsEqual.equalTo; +import static org.hamcrest.internal.NullSafety.nullSafe; public class IsIterableContainingInOrder
assertThat(Arrays.asList("foo", "bar"), contains("foo", "bar"))* @@ -108,7 +109,6 @@ public static
assertThat(Arrays.asList("foo"), contains(equalTo("foo")))* @@ -127,7 +127,6 @@ public static
assertThat(Arrays.asList("foo", "bar"), contains(equalTo("foo"), equalTo("bar")))* @@ -136,7 +135,9 @@ public static
assertThat(Arrays.asList("foo", "bar"), contains(Arrays.asList(equalTo("foo"), equalTo("bar"))))* @@ -157,13 +157,4 @@ public static
assertThat(Arrays.asList("foo", "bar"), iterableWithSize(equalTo(2)))* @@ -44,7 +43,6 @@ public static
size
argument.
- *
* For example:
* assertThat(Arrays.asList("foo", "bar"), iterableWithSize(2))* diff --git a/hamcrest-library/src/main/java/org/hamcrest/collection/IsMapContaining.java b/hamcrest-library/src/main/java/org/hamcrest/collection/IsMapContaining.java index 392c554c..618d3b96 100644 --- a/hamcrest-library/src/main/java/org/hamcrest/collection/IsMapContaining.java +++ b/hamcrest-library/src/main/java/org/hamcrest/collection/IsMapContaining.java @@ -48,7 +48,6 @@ public void describeTo(Description description) { * Creates a matcher for {@link java.util.Map}s matching when the examined {@link java.util.Map} contains * at least one entry whose key satisfies the specified
keyMatcher
and whose
* value satisfies the specified valueMatcher
.
- *
* For example:
* assertThat(myMap, hasEntry(equalTo("bar"), equalTo("foo")))* @@ -66,7 +65,6 @@ public static