diff --git a/guava/src/test/java/org/baeldung/hamcrest/HamcrestExamplesUnitTest.java b/guava/src/test/java/org/baeldung/hamcrest/HamcrestExamplesUnitTest.java index 6b9cee1992..82b6b8c87c 100644 --- a/guava/src/test/java/org/baeldung/hamcrest/HamcrestExamplesUnitTest.java +++ b/guava/src/test/java/org/baeldung/hamcrest/HamcrestExamplesUnitTest.java @@ -12,6 +12,7 @@ import static org.hamcrest.Matchers.hasItems; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.not; import static org.junit.Assert.assertThat; +import static org.hamcrest.Matchers.emptyIterable; import java.util.Collections; import java.util.List; @@ -57,6 +58,12 @@ public class HamcrestExamplesUnitTest { final List collection = Lists.newArrayList(); assertThat(collection, empty()); } + + @Test + public final void givenIterableIsEmpty_whenChecking_thenEmpty() { + final Iterable collection = Lists.newArrayList(); + assertThat(collection, emptyIterable()); + } @Test public final void givenCollectionIsNotEmpty_whenChecking_thenNotEmpty() {