Skip to content

Commit 21f0bdf

Browse files
authored
Merge pull request eugenp#4201 from eugenp/hamcrest-iterable
emptyiterable ex
2 parents 1b8a00e + 75afb5d commit 21f0bdf

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎guava/src/test/java/org/baeldung/hamcrest/HamcrestExamplesUnitTest.java‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import static org.hamcrest.Matchers.hasSize;
1313
import static org.hamcrest.Matchers.not;
1414
import static org.junit.Assert.assertThat;
15+
import static org.hamcrest.Matchers.emptyIterable;
1516

1617
import java.util.Collections;
1718
import java.util.List;
@@ -57,6 +58,12 @@ public final void givenCollectionIsEmpty_whenChecking_thenEmpty() {
5758
final List<String> collection = Lists.newArrayList();
5859
assertThat(collection, empty());
5960
}
61+
62+
@Test
63+
public final void givenIterableIsEmpty_whenChecking_thenEmpty() {
64+
final Iterable<String> collection = Lists.newArrayList();
65+
assertThat(collection, emptyIterable());
66+
}
6067

6168
@Test
6269
public final void givenCollectionIsNotEmpty_whenChecking_thenNotEmpty() {

0 commit comments

Comments
 (0)