Matcher<java.util.Collection<? extends E>>, SelfDescribingpublic class IsEmptyCollection<E> extends TypeSafeMatcher<java.util.Collection<? extends E>>
| Constructor | Description |
|---|---|
IsEmptyCollection() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
describeMismatchSafely(java.util.Collection<? extends E> item,
Description mismatchDescription) |
Subclasses should override this.
|
void |
describeTo(Description description) |
Generates a description of the object.
|
static <E> Matcher<java.util.Collection<? extends E>> |
empty() |
Creates a matcher for
Collections matching examined collections whose isEmpty
method returns true. |
static <E> Matcher<java.util.Collection<E>> |
emptyCollectionOf(java.lang.Class<E> type) |
Creates a matcher for
Collections matching examined collections whose isEmpty
method returns true. |
boolean |
matchesSafely(java.util.Collection<? extends E> item) |
Subclasses should implement this.
|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdescribeMismatch, matchespublic boolean matchesSafely(java.util.Collection<? extends E> item)
TypeSafeMatchermatchesSafely in class TypeSafeMatcher<java.util.Collection<? extends E>>public void describeMismatchSafely(java.util.Collection<? extends E> item, Description mismatchDescription)
TypeSafeMatcherdescribeMismatchSafely in class TypeSafeMatcher<java.util.Collection<? extends E>>public void describeTo(Description description)
SelfDescribingdescription - The description to be built or appended to.public static <E> Matcher<java.util.Collection<? extends E>> empty()
Collections matching examined collections whose isEmpty
method returns true.
For example:
assertThat(new ArrayList<String>(), is(empty()))
public static <E> Matcher<java.util.Collection<E>> emptyCollectionOf(java.lang.Class<E> type)
Collections matching examined collections whose isEmpty
method returns true.
For example:
assertThat(new ArrayList<String>(), is(emptyCollectionOf(String.class)))
type - the type of the collection's content