Skip to content

Commit 65c7cc6

Browse files
author
smgfreeman
committed
sf. To prove Issue 43: Compile errors on hasSize
1 parent 5f02100 commit 65c7cc6

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎hamcrest-unit-test/src/main/java/org/hamcrest/collection/IsCollectionWithSizeTest.java‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package org.hamcrest.collection;
22

33
import static java.util.Arrays.asList;
4+
5+
import java.util.ArrayList;
46
import java.util.List;
57
import java.util.Collection;
68

@@ -9,6 +11,7 @@
911

1012
import org.hamcrest.AbstractMatcherTest;
1113
import org.hamcrest.Matcher;
14+
import org.hamcrest.MatcherAssert;
1215

1316
public class IsCollectionWithSizeTest extends AbstractMatcherTest {
1417

@@ -66,4 +69,10 @@ public void testProvidesConvenientShortcutForHasSizeEqualTo() {
6669
public void testHasAReadableDescription() {
6770
assertDescription("a collection with size <3>", hasSize(equalTo(3)));
6871
}
72+
73+
public void testCompilesWithATypedCollection() {
74+
// To prove Issue 43
75+
ArrayList<String> arrayList = new ArrayList<String>();
76+
MatcherAssert.assertThat(arrayList, hasSize(0));
77+
}
6978
}

0 commit comments

Comments
 (0)