All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.junit.internal.matchers.Each Maven / Gradle / Ivy

Go to download

JUnit is a regression testing framework written by Erich Gamma and Kent Beck. It is used by the developer who implements unit tests in Java.

There is a newer version: 4.11
Show newest version
package org.junit.internal.matchers;

import static org.hamcrest.CoreMatchers.not;
import static org.junit.internal.matchers.IsCollectionContaining.hasItem;
import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;
import org.hamcrest.Matcher;

public class Each {
	public static  Matcher> each(final Matcher individual) {
		final Matcher> allItemsAre = not(hasItem(not(individual)));
		
		return new BaseMatcher>() {
			public boolean matches(Object item) {
				return allItemsAre.matches(item);
			}
			
			public void describeTo(Description description) {
				description.appendText("each ");
				individual.describeTo(description);
			}
		};
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy