From dfe25d28341c3e7517b92b08f2cc80587fb4b90d Mon Sep 17 00:00:00 2001
From: gokareless
Date: Sun, 6 Sep 2020 01:41:30 +0300
Subject: [PATCH 01/54] - Adjusted API to work with embedded arrays
---
.../IsIterableContainingInAnyOrder.java | 11 ++++++--
.../IsIterableContainingInOrder.java | 5 ++++
.../test/java/org/hamcrest/MatchersTest.java | 28 +++++++++++++++++++
.../core/IsIterableContainingTest.java | 22 +++++++++++++++
4 files changed, 64 insertions(+), 2 deletions(-)
create mode 100644 hamcrest/src/test/java/org/hamcrest/MatchersTest.java
diff --git a/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java b/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java
index d6a9a33d..5756c278 100644
--- a/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java
+++ b/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java
@@ -124,10 +124,17 @@ public static Matcher> containsInAnyOrder(Matcher su
@SafeVarargs
public static Matcher> containsInAnyOrder(T... items) {
List> matchers = new ArrayList<>();
- for (T item : items) {
+ if (items.length == 1 && items[0].getClass().isArray()) {
+ @SuppressWarnings("unchecked")
+ T[] realItems = (T[]) items[0];
+ for (T item : realItems) {
matchers.add(equalTo(item));
+ }
+ } else {
+ for (T item : items) {
+ matchers.add(equalTo(item));
+ }
}
-
return new IsIterableContainingInAnyOrder<>(matchers);
}
diff --git a/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInOrder.java b/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInOrder.java
index ed62aa29..fb433df7 100644
--- a/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInOrder.java
+++ b/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInOrder.java
@@ -94,6 +94,11 @@ private void describeMismatch(Matcher super F> matcher, F item) {
*/
@SafeVarargs
public static Matcher> contains(E... items) {
+ if (items.length == 1 && items[0].getClass().isArray()) {
+ @SuppressWarnings("unchecked")
+ E[] realItems = (E[]) items[0];
+ return contains(asEqualMatchers(realItems));
+ }
return contains(asEqualMatchers(items));
}
diff --git a/hamcrest/src/test/java/org/hamcrest/MatchersTest.java b/hamcrest/src/test/java/org/hamcrest/MatchersTest.java
new file mode 100644
index 00000000..e2395e6f
--- /dev/null
+++ b/hamcrest/src/test/java/org/hamcrest/MatchersTest.java
@@ -0,0 +1,28 @@
+package org.hamcrest;
+
+import java.util.Arrays;
+import org.hamcrest.core.AnyOf;
+import org.junit.Test;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.contains;
+import static org.hamcrest.Matchers.containsInAnyOrder;
+
+public class MatchersTest {
+
+ @Test
+ public void matchersContainsInAnyOrderCastTest() {
+ String[] truth = new String[] { "1", "2" };
+ assertThat("doesn't contain elements", Arrays.asList("1", "2"), containsInAnyOrder(truth));
+ Object otherTruth = truth;
+ assertThat("doesn't contain elements", Arrays.asList("1", "2"), containsInAnyOrder(otherTruth));
+ }
+
+ @Test
+ public void matchersContainsCastTest() {
+ String[] truth = new String[] { "1", "2" };
+ assertThat("doesn't contain elements", Arrays.asList("1", "2"), contains(truth));
+ Object otherTruth = truth;
+ assertThat("doesn't contain elements", Arrays.asList("1", "2"), contains(otherTruth));
+ }
+}
diff --git a/hamcrest/src/test/java/org/hamcrest/core/IsIterableContainingTest.java b/hamcrest/src/test/java/org/hamcrest/core/IsIterableContainingTest.java
index 02148b81..86787dfa 100644
--- a/hamcrest/src/test/java/org/hamcrest/core/IsIterableContainingTest.java
+++ b/hamcrest/src/test/java/org/hamcrest/core/IsIterableContainingTest.java
@@ -6,6 +6,7 @@
import org.junit.Test;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
@@ -13,6 +14,8 @@
import static org.hamcrest.AbstractMatcherTest.*;
import static org.hamcrest.core.IsIterableContaining.hasItem;
import static org.hamcrest.core.IsIterableContaining.hasItems;
+import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder;
+import static org.hamcrest.collection.IsIterableContainingInOrder.contains;
import static org.hamcrest.core.IsEqual.equalTo;
public final class IsIterableContainingTest {
@@ -86,6 +89,25 @@ public final class IsIterableContainingTest {
matcher, asList(1, 2, 3));
}
+ @Test public void
+ isIterableContainingAnyOrderCast() {
+ String[] array = new String[]{"1", "2"};
+ Object object = array;
+ Iterable real = Arrays.asList("1", "2");
+ final Matcher> matcher = containsInAnyOrder(object);
+ assertTrue("does not match the same object", matcher.matches(real));
+ }
+
+ @Test
+ public void
+ isIterableContainingCast() {
+ String[] array = new String[]{"1", "2"};
+ Object object = array;
+ Iterable real = Arrays.asList("1", "2");
+ final Matcher> matcher = contains(object);
+ assertTrue("does not match the same object", matcher.matches(real));
+ }
+
private static Matcher super String> mismatchable(final String string) {
return new TypeSafeDiagnosingMatcher() {
@Override
From f0e2d0e8351891e35d98dbf328d1c2a731cf1f6d Mon Sep 17 00:00:00 2001
From: Karl-Philipp Richter
Date: Thu, 29 Mar 2018 17:45:41 +0200
Subject: [PATCH 02/54] exposed IsEqualCompressingWhiteSpace.string in
protected getString in order to facilitate use in subclasses
---
.../java/org/hamcrest/text/IsEqualCompressingWhiteSpace.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hamcrest/src/main/java/org/hamcrest/text/IsEqualCompressingWhiteSpace.java b/hamcrest/src/main/java/org/hamcrest/text/IsEqualCompressingWhiteSpace.java
index 1bf266af..5618627e 100644
--- a/hamcrest/src/main/java/org/hamcrest/text/IsEqualCompressingWhiteSpace.java
+++ b/hamcrest/src/main/java/org/hamcrest/text/IsEqualCompressingWhiteSpace.java
@@ -21,6 +21,10 @@ public IsEqualCompressingWhiteSpace(String string) {
this.string = string;
}
+ protected String getString() {
+ return string;
+ }
+
@Override
public boolean matchesSafely(String item) {
return stripSpaces(string).equals(stripSpaces(item));
From f6abc8c1e1f148d99cf3e168eeb4b395acfebe24 Mon Sep 17 00:00:00 2001
From: John Patrick <142304+nhojpatrick@users.noreply.github.com>
Date: Sun, 13 Feb 2022 15:53:46 +0000
Subject: [PATCH 03/54] JavaDoc only @param org.hamcrest.beans
---
hamcrest/src/main/java/org/hamcrest/beans/HasProperty.java | 2 ++
.../main/java/org/hamcrest/beans/HasPropertyWithValue.java | 4 ++++
hamcrest/src/main/java/org/hamcrest/beans/PropertyUtil.java | 4 ++++
.../main/java/org/hamcrest/beans/SamePropertyValuesAs.java | 2 ++
4 files changed, 12 insertions(+)
diff --git a/hamcrest/src/main/java/org/hamcrest/beans/HasProperty.java b/hamcrest/src/main/java/org/hamcrest/beans/HasProperty.java
index 3a7cfe65..07181c2a 100644
--- a/hamcrest/src/main/java/org/hamcrest/beans/HasProperty.java
+++ b/hamcrest/src/main/java/org/hamcrest/beans/HasProperty.java
@@ -46,6 +46,8 @@ public void describeTo(Description description) {
* For example:
*
assertThat(myBean, hasProperty("foo"))
*
+ * @param
+ * the matcher type.
* @param propertyName
* the name of the JavaBean property that examined beans should possess
* @return The matcher.
diff --git a/hamcrest/src/main/java/org/hamcrest/beans/HasPropertyWithValue.java b/hamcrest/src/main/java/org/hamcrest/beans/HasPropertyWithValue.java
index 1bf81dec..e4aca0dd 100644
--- a/hamcrest/src/main/java/org/hamcrest/beans/HasPropertyWithValue.java
+++ b/hamcrest/src/main/java/org/hamcrest/beans/HasPropertyWithValue.java
@@ -155,6 +155,8 @@ public Condition apply(PropertyDescriptor property, Description mismatch
* For example:
*
*
+ * @param
+ * the matcher type.
* @param propertyName
* the name of the JavaBean property that examined beans should possess
* @param valueMatcher
@@ -173,6 +175,8 @@ public static Matcher hasProperty(String propertyName, Matcher> valueMa
* For example:
*
*
+ * @param
+ * the matcher type.
* @param path
* the dot-separated path from the examined object to the JavaBean property
* @param valueMatcher
diff --git a/hamcrest/src/main/java/org/hamcrest/beans/PropertyUtil.java b/hamcrest/src/main/java/org/hamcrest/beans/PropertyUtil.java
index d1564653..99f933ea 100644
--- a/hamcrest/src/main/java/org/hamcrest/beans/PropertyUtil.java
+++ b/hamcrest/src/main/java/org/hamcrest/beans/PropertyUtil.java
@@ -18,6 +18,10 @@ public class PropertyUtil {
* Returns the description of the property with the provided
* name on the provided object's interface.
*
+ * @param propertyName
+ * the bean property name.
+ * @param fromObj
+ * the object to check.
* @return the descriptor of the property, or null if the property does not exist.
* @throws IllegalArgumentException if there's a introspection failure
*/
diff --git a/hamcrest/src/main/java/org/hamcrest/beans/SamePropertyValuesAs.java b/hamcrest/src/main/java/org/hamcrest/beans/SamePropertyValuesAs.java
index c36203f7..ab723d86 100644
--- a/hamcrest/src/main/java/org/hamcrest/beans/SamePropertyValuesAs.java
+++ b/hamcrest/src/main/java/org/hamcrest/beans/SamePropertyValuesAs.java
@@ -147,6 +147,8 @@ private static Object readProperty(Method method, Object target) {
*
*
+ * @param
+ * the matcher type.
* @param elementMatcher
* the matcher to apply to elements in examined arrays
* @return The matcher.
@@ -39,6 +41,8 @@ public static Matcher hasItemInArray(Matcher super T> elementMatcher)
* instead of:
*
assertThat(hasItemInArray(equalTo(x)))
*
+ * @param
+ * the matcher type.
* @param element
* the element that should be present in examined arrays
* @return The matcher.
@@ -64,6 +68,8 @@ public static Matcher hasItemInArray(T element) {
*
*
+ * @param
+ * the matcher type.
* @param itemMatchers
* a list of matchers, each of which must be satisfied by an entry in an examined array
* @return The matcher.
@@ -90,6 +96,8 @@ public static Matcher arrayContainingInAnyOrder(Matcher super E>... i
*
*
*
+ * @param
+ * the matcher type.
* @param itemMatchers
* a list of matchers, each of which must be satisfied by an item provided by an examined array
* @return The matcher.
@@ -113,6 +121,8 @@ public static Matcher arrayContainingInAnyOrder(Collection
*
*
+ * @param
+ * the matcher type.
* @param items
* the items that must equal the entries of an examined array, in any order
* @return The matcher.
@@ -129,6 +139,8 @@ public static Matcher arrayContainingInAnyOrder(E... items) {
* For example:
*
*
+ * @param
+ * the matcher type.
* @param items
* the items that must equal the items within an examined array
* @return The matcher.
@@ -144,6 +156,8 @@ public static Matcher arrayContaining(E... items) {
* For example:
*
*
+ * @param
+ * the matcher type.
* @param itemMatchers
* the matchers that must be satisfied by the items in the examined array
* @return The matcher.
@@ -164,6 +178,8 @@ public static Matcher arrayContaining(Matcher super E>... itemMatcher
* For example:
*
*
+ * @param
+ * the matcher type.
* @param itemMatchers
* a list of matchers, each of which must be satisfied by the corresponding item in an examined array
* @return The matcher.
diff --git a/hamcrest/src/main/java/org/hamcrest/collection/IsArray.java b/hamcrest/src/main/java/org/hamcrest/collection/IsArray.java
index 22fef90a..4e7a1230 100644
--- a/hamcrest/src/main/java/org/hamcrest/collection/IsArray.java
+++ b/hamcrest/src/main/java/org/hamcrest/collection/IsArray.java
@@ -93,6 +93,8 @@ protected String descriptionEnd() {
* For example:
*
*
+ * @param
+ * the matcher type.
* @param elementMatchers
* the matchers that the elements of examined arrays should satisfy
* @return The matcher.
diff --git a/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInAnyOrder.java b/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInAnyOrder.java
index 3157bcce..162156b4 100644
--- a/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInAnyOrder.java
+++ b/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInAnyOrder.java
@@ -54,7 +54,8 @@ public void describeTo(Description description) {
*
*
* @deprecated As of version 2.1, use {@link ArrayMatching#arrayContainingInAnyOrder(Matcher[])}.
- *
+ * @param
+ * the matcher type.
* @param itemMatchers
* a list of matchers, each of which must be satisfied by an entry in an examined array
* @return The matcher.
@@ -77,7 +78,8 @@ public static Matcher arrayContainingInAnyOrder(Matcher super E>... i
*
*
* @deprecated As of version 2.1, use {@link ArrayMatching#arrayContainingInAnyOrder(Collection)}.
- *
+ * @param
+ * the matcher type.
* @param itemMatchers
* a list of matchers, each of which must be satisfied by an item provided by an examined array
* @return The matcher.
@@ -100,7 +102,8 @@ public static Matcher arrayContainingInAnyOrder(CollectionassertThat(new String[]{"foo", "bar"}, containsInAnyOrder("bar", "foo"))
*
* @deprecated As of version 2.1, use {@link ArrayMatching#arrayContainingInAnyOrder(Object[])}.
- *
+ * @param
+ * the matcher type.
* @param items
* the items that must equal the entries of an examined array, in any order
* @return The matcher.
diff --git a/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInOrder.java b/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInOrder.java
index e26cc462..6e46d472 100644
--- a/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInOrder.java
+++ b/hamcrest/src/main/java/org/hamcrest/collection/IsArrayContainingInOrder.java
@@ -47,7 +47,8 @@ public void describeTo(Description description) {
*
*
* @deprecated As of version 2.1, use {@link ArrayMatching#arrayContaining(Object[])}.
- *
+ * @param
+ * the matcher type.
* @param items
* the items that must equal the items within an examined array
* @return The matcher.
@@ -69,7 +70,8 @@ public static Matcher arrayContaining(E... items) {
*
*
* @deprecated As of version 2.1, use {@link ArrayMatching#arrayContaining(Matcher[])}.
- *
+ * @param
+ * the matcher type.
* @param itemMatchers
* the matchers that must be satisfied by the items in the examined array
* @return The matcher.
@@ -87,7 +89,8 @@ public static Matcher arrayContaining(Matcher super E>... itemMatcher
*
*
* @deprecated As of version 2.1, use {@link ArrayMatching#arrayContaining(List)}.
- *
+ * @param
+ * the matcher type.
* @param itemMatchers
* a list of matchers, each of which must be satisfied by the corresponding item in an examined array
* @return The matcher.
diff --git a/hamcrest/src/main/java/org/hamcrest/collection/IsArrayWithSize.java b/hamcrest/src/main/java/org/hamcrest/collection/IsArrayWithSize.java
index d779691f..b4441437 100644
--- a/hamcrest/src/main/java/org/hamcrest/collection/IsArrayWithSize.java
+++ b/hamcrest/src/main/java/org/hamcrest/collection/IsArrayWithSize.java
@@ -24,7 +24,8 @@ protected Integer featureValueOf(E[] actual) {
* satisfies the specified matcher.
* For example:
*
- *
+ * @param
+ * the matcher type.
* @param sizeMatcher
* a matcher for the length of an examined array
* @return The matcher.
@@ -39,6 +40,8 @@ public static Matcher arrayWithSize(Matcher super Integer> sizeMatche
* For example:
*
*
+ * @param
+ * the matcher type.
* @param size
* the length that an examined array must have for a positive match
* @return The matcher.
@@ -53,6 +56,8 @@ public static Matcher arrayWithSize(int size) {
* For example:
*
assertThat(new String[0], emptyArray())
*
+ * @param
+ * the matcher type.
* @return The matcher.
*/
public static Matcher emptyArray() {
diff --git a/hamcrest/src/main/java/org/hamcrest/collection/IsCollectionWithSize.java b/hamcrest/src/main/java/org/hamcrest/collection/IsCollectionWithSize.java
index 8ff37131..2143046c 100644
--- a/hamcrest/src/main/java/org/hamcrest/collection/IsCollectionWithSize.java
+++ b/hamcrest/src/main/java/org/hamcrest/collection/IsCollectionWithSize.java
@@ -26,6 +26,8 @@ protected Integer featureValueOf(Collection extends E> actual) {
* For example:
*
*
+ * @param
+ * the matcher type.
* @param sizeMatcher
* a matcher for the size of an examined {@link java.util.Collection}
* @return The matcher.
@@ -40,6 +42,8 @@ public static Matcher> hasSize(Matcher super Integ
* For example:
*
*
* @deprecated use is(in(...)) instead
- *
+ * @param
+ * the matcher type.
* @param collection
* the collection in which matching items must be found
* @return The matcher.
@@ -53,6 +54,8 @@ public static Matcher isIn(Collection collection) {
* For example:
*
*
+ * @param
+ * the matcher type.
* @param collection
* the collection in which matching items must be found
* @return The matcher.
@@ -68,7 +71,8 @@ public static Matcher in(Collection collection) {
*
*
* @deprecated use is(in(...)) instead
- *
+ * @param
+ * the matcher type.
* @param elements
* the array in which matching items must be found
* @return The matcher.
@@ -84,6 +88,8 @@ public static Matcher isIn(T[] elements) {
* For example:
*
*
+ * @param
+ * the matcher type.
* @param elements
* the array in which matching items must be found
* @return The matcher.
@@ -99,7 +105,8 @@ public static Matcher in(T[] elements) {
*
assertThat("foo", isOneOf("bar", "foo"))
*
* @deprecated use is(oneOf(...)) instead
- *
+ * @param
+ * the matcher type.
* @param elements
* the elements amongst which matching items will be found
* @return The matcher.
@@ -116,6 +123,8 @@ public static Matcher isOneOf(T... elements) {
* For example:
*
assertThat("foo", is(oneOf("bar", "foo")))
*
+ * @param
+ * the matcher type.
* @param elements
* the elements amongst which matching items will be found
* @return The matcher.
diff --git a/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java b/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java
index daaf9277..975e44df 100644
--- a/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java
+++ b/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInAnyOrder.java
@@ -93,6 +93,8 @@ private boolean isMatched(S item) {
*
*
*
+ * @param
+ * the matcher type.
* @param itemMatchers
* a list of matchers, each of which must be satisfied by an item provided by an examined {@link Iterable}
* @return The matcher.
@@ -119,6 +121,8 @@ public static Matcher> containsInAnyOrder(Matcher su
*
*
*
+ * @param
+ * the matcher type.
* @param items
* the items that must equal the items provided by an examined {@link Iterable} in any order
* @return The matcher.
@@ -148,6 +152,8 @@ public static Matcher> containsInAnyOrder(T... items)
*
*
+ * @param
+ * the matcher type.
* @param itemMatchers
* a list of matchers, each of which must be satisfied by an item provided by an examined {@link Iterable}
* @return The matcher.
diff --git a/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInOrder.java b/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInOrder.java
index 5f30d379..d7736c11 100644
--- a/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInOrder.java
+++ b/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInOrder.java
@@ -89,6 +89,8 @@ private void describeMismatch(Matcher super F> matcher, F item) {
* For example:
*
*
+ * @param
+ * the matcher type.
* @param items
* the items that must equal the items provided by an examined {@link Iterable}
* @return The matcher.
@@ -105,6 +107,8 @@ public static Matcher> contains(E... items) {
* For example:
*
*
+ * @param
+ * the matcher type.
* @param itemMatcher
* the matcher that must be satisfied by the single item provided by an
* examined {@link Iterable}
@@ -123,6 +127,8 @@ public static Matcher> contains(final Matcher super
* For example:
*
*
+ * @param
+ * the matcher type.
* @param itemMatchers
* the matchers that must be satisfied by the items provided by an examined {@link Iterable}
* @return The matcher.
@@ -143,6 +149,8 @@ public static Matcher> contains(Matcher super E>...
* For example:
*
*
+ * @param
+ * the matcher type.
* @param itemMatchers
* a list of matchers, each of which must be satisfied by the corresponding item provided by
* an examined {@link Iterable}
diff --git a/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInRelativeOrder.java b/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInRelativeOrder.java
index 9a505516..7ed7f2e2 100644
--- a/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInRelativeOrder.java
+++ b/hamcrest/src/main/java/org/hamcrest/collection/IsIterableContainingInRelativeOrder.java
@@ -74,6 +74,8 @@ public boolean isFinished() {
* For example:
*
*
+ * @param
+ * the matcher type.
* @param items
* the items that must be contained within items provided by an examined {@link Iterable} in the same relative order
* @return The matcher.
@@ -95,6 +97,8 @@ public static Matcher> containsInRelativeOrder(E... it
* For example:
*
*
+ * @param
+ * the matcher type.
* @param itemMatchers
* the matchers that must be satisfied by the items provided by an examined {@link Iterable} in the same relative order
* @return The matcher.
@@ -111,6 +115,8 @@ public static Matcher> containsInRelativeOrder(Matcher
* For example:
*
*
+ * @param
+ * the matcher type.
* @param itemMatchers
* a list of matchers, each of which must be satisfied by the items provided by
* an examined {@link Iterable} in the same relative order
diff --git a/hamcrest/src/main/java/org/hamcrest/collection/IsIterableWithSize.java b/hamcrest/src/main/java/org/hamcrest/collection/IsIterableWithSize.java
index 9d2a69c9..95d53b4f 100644
--- a/hamcrest/src/main/java/org/hamcrest/collection/IsIterableWithSize.java
+++ b/hamcrest/src/main/java/org/hamcrest/collection/IsIterableWithSize.java
@@ -30,6 +30,8 @@ protected Integer featureValueOf(Iterable actual) {
* For example:
*
*
+ * @param
+ * the matcher type.
* @param sizeMatcher
* a matcher for the number of items that should be yielded by an examined {@link Iterable}
* @return The matcher.
@@ -45,6 +47,8 @@ public static Matcher> iterableWithSize(Matcher super Integer>
* For example:
*
*
+ * @param
+ * the matcher type.
* @param size
* the number of items that should be yielded by an examined {@link Iterable}
* @return The matcher.
diff --git a/hamcrest/src/main/java/org/hamcrest/collection/IsMapContaining.java b/hamcrest/src/main/java/org/hamcrest/collection/IsMapContaining.java
index 130e69c6..ac9d473f 100644
--- a/hamcrest/src/main/java/org/hamcrest/collection/IsMapContaining.java
+++ b/hamcrest/src/main/java/org/hamcrest/collection/IsMapContaining.java
@@ -50,6 +50,10 @@ public void describeTo(Description description) {
* For example:
*
*
+ * @param
+ * the map key type.
+ * @param
+ * the map value type.
* @param keyMatcher
* the key matcher that, in combination with the valueMatcher, must be satisfied by at least one entry
* @param valueMatcher
@@ -67,6 +71,10 @@ public static Matcher