public class IsEmptyCollection<E> extends TypeSafeMatcher<java.util.Collection<? extends E>>
Constructor and Description |
---|
IsEmptyCollection() |
Modifier and Type | Method and 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
Collection s matching examined collections whose isEmpty
method returns true . |
static <E> Matcher<java.util.Collection<E>> |
emptyCollectionOf(java.lang.Class<E> unusedToForceReturnType)
Creates a matcher for
Collection s matching examined collections whose isEmpty
method returns true . |
boolean |
matchesSafely(java.util.Collection<? extends E> item)
Subclasses should implement this.
|
describeMismatch, matches
_dont_implement_Matcher___instead_extend_BaseMatcher_, isNotNull, toString
public boolean matchesSafely(java.util.Collection<? extends E> item)
TypeSafeMatcher
matchesSafely
in class TypeSafeMatcher<java.util.Collection<? extends E>>
public void describeMismatchSafely(java.util.Collection<? extends E> item, Description mismatchDescription)
TypeSafeMatcher
describeMismatchSafely
in class TypeSafeMatcher<java.util.Collection<? extends E>>
public void describeTo(Description description)
SelfDescribing
description
- The description to be built or appended to.public static <E> Matcher<java.util.Collection<? extends E>> empty()
Collection
s 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> unusedToForceReturnType)
Collection
s matching examined collections whose isEmpty
method returns true
.
For example:
assertThat(new ArrayList<String>(), is(emptyCollectionOf(String.class)))
unusedToForceReturnType
- the type of the collection's content