public class

IsCollectionContaining

extends TypeSafeMatcher<T>
java.lang.Object
   ↳ org.hamcrest.BaseMatcher<T>
     ↳ org.junit.internal.matchers.TypeSafeMatcher<T>
       ↳ org.junit.internal.matchers.IsCollectionContaining<T>

Summary

Public Constructors
IsCollectionContaining(Matcher<? extends T> elementMatcher)
Public Methods
void describeTo(Description description)
static <T> Matcher<Iterable<T>> hasItem(T element)
static <T> Matcher<Iterable<T>> hasItem(Matcher<? extends T> elementMatcher)
static <T> Matcher<Iterable<T>> hasItems(T... elements)
static <T> Matcher<Iterable<T>> hasItems(Matcher...<? extends T> elementMatchers)
boolean matchesSafely(Iterable<T> collection)
Subclasses should implement this.
[Expand]
Inherited Methods
From class org.junit.internal.matchers.TypeSafeMatcher
From class org.hamcrest.BaseMatcher
From class java.lang.Object
From interface org.hamcrest.Matcher
From interface org.hamcrest.SelfDescribing

Public Constructors

public IsCollectionContaining (Matcher<? extends T> elementMatcher)

Public Methods

public void describeTo (Description description)

public static Matcher<Iterable<T>> hasItem (T element)

public static Matcher<Iterable<T>> hasItem (Matcher<? extends T> elementMatcher)

public static Matcher<Iterable<T>> hasItems (T... elements)

public static Matcher<Iterable<T>> hasItems (Matcher...<? extends T> elementMatchers)

public boolean matchesSafely (Iterable<T> collection)

Subclasses should implement this. The item will already have been checked for the specific type and will never be null.