// Path: mockito-collections-core/src/test/java/uk/co/webamoeba/mockito/collections/support/ThrowableCausedByMatcher.java
// public class ThrowableCausedByMatcher extends BaseMatcher<Throwable> {
// 
// 	private Class<? extends Throwable> causedByClass;
// 
// 	public ThrowableCausedByMatcher(Class<? extends Throwable> causedByClass) {
// 		super();
// 		this.causedByClass = causedByClass;
// 	}
// 
// 	public boolean matches(Object object) {
// 		if (object == null) {
// 			return false;
// 		}
// 		if (!Throwable.class.isAssignableFrom(object.getClass())) {
// 			return false;
// 		}
// 		Throwable causedBy = ((Throwable) object).getCause();
// 		while (causedBy != null) {
// 			if (causedBy.getClass().equals(causedByClass)) {
// 				return true;
// 			}
// 			causedBy = causedBy.getCause();
// 		}
// 		return false;
// 	}
// 
// 	public void describeTo(Description description) {
// 		description.appendText("throwable caused by " + causedByClass);
// 	}
// 
// }


import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.mock;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.mockito.exceptions.verification.NoInteractionsWanted;
import org.mockito.exceptions.verification.WantedButNotInvoked;
import uk.co.webamoeba.mockito.collections.support.ThrowableCausedByMatcher;
package uk.co.webamoeba.mockito.collections.internal;





/**
 * @author James Kennard
 */
public class VerifierTest {

	private Verifier verification = new Verifier();

	@Rule
	public ExpectedException thrown = ExpectedException.none();

	@Test
	public void shouldCollectiveVerifyGivenWantedButNotInvoked() throws IOException {
		// Given
		Closeable mock = mock(Closeable.class);
		Collection<Closeable> collection = Collections.singleton(mock);

// Path: mockito-collections-core/src/test/java/uk/co/webamoeba/mockito/collections/support/ThrowableCausedByMatcher.java
// public class ThrowableCausedByMatcher extends BaseMatcher<Throwable> {
// 
// 	private Class<? extends Throwable> causedByClass;
// 
// 	public ThrowableCausedByMatcher(Class<? extends Throwable> causedByClass) {
// 		super();
// 		this.causedByClass = causedByClass;
// 	}
// 
// 	public boolean matches(Object object) {
// 		if (object == null) {
// 			return false;
// 		}
// 		if (!Throwable.class.isAssignableFrom(object.getClass())) {
// 			return false;
// 		}
// 		Throwable causedBy = ((Throwable) object).getCause();
// 		while (causedBy != null) {
// 			if (causedBy.getClass().equals(causedByClass)) {
// 				return true;
// 			}
// 			causedBy = causedBy.getCause();
// 		}
// 		return false;
// 	}
// 
// 	public void describeTo(Description description) {
// 		description.appendText("throwable caused by " + causedByClass);
// 	}
// 
// }


// Path: mockito-collections-core/src/test/java/uk/co/webamoeba/mockito/collections/internal/VerifierTest.java
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.mock;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.mockito.exceptions.verification.NoInteractionsWanted;
import org.mockito.exceptions.verification.WantedButNotInvoked;
import uk.co.webamoeba.mockito.collections.support.ThrowableCausedByMatcher;

package uk.co.webamoeba.mockito.collections.internal;





/**
 * @author James Kennard
 */
public class VerifierTest {

	private Verifier verification = new Verifier();

	@Rule
	public ExpectedException thrown = ExpectedException.none();

	@Test
	public void shouldCollectiveVerifyGivenWantedButNotInvoked() throws IOException {
		// Given
		Closeable mock = mock(Closeable.class);
		Collection<Closeable> collection = Collections.singleton(mock);

		thrown.expect(new ThrowableCausedByMatcher(WantedButNotInvoked.class));