package org.hamcrest.core;

import org.hamcrest.StringDescription;
import org.junit.Test;

import java.util.ArrayList;

import static java.util.Arrays.asList;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.IsNot.not;
import static org.hamcrest.core.StringContains.containsString;
import static org.junit.Assert.assertEquals;

public class EveryTest {
    @Test public void isTrueWhenEveryValueMatches() {
        assertThat(asList("AaA", "BaB", "CaC"), Every.everyItem(containsString("a")));
        assertThat(asList("AbA", "BbB", "CbC"), not(Every.everyItem(containsString("a"))));
    }

    @Test public void isAlwaysTrueForEmptyLists() {
        assertThat(new ArrayList<String>(), Every.everyItem(containsString("a")));
    }

    @Test public void describesItself() {
        final Every<String> each=  new Every<String>(containsString("a"));
        assertEquals("every item is a string containing \"a\"", each.toString());
        
        StringDescription description = new StringDescription(); 
        each.matchesSafely(asList("BbB"), description);
        assertEquals("an item was \"BbB\"", description.toString());
    }
}

@@ -32,130 +32,307 @@
 ort 
-org.hamcrest.StringDescription;%0Aimport org.junit.Test;%0A%0Aimport java.util.ArrayList;%0A%0Aimport static java.util.Arrays.asList
+static java.util.Arrays.asList;%0Aimport static org.hamcrest.AbstractMatcherTest.assertDescription;%0Aimport static org.hamcrest.AbstractMatcherTest.assertDoesNotMatch;%0Aimport static org.hamcrest.AbstractMatcherTest.assertMatches;%0Aimport static org.hamcrest.AbstractMatcherTest.assertMismatchDescription
 ;%0Aim
@@ -360,28 +360,34 @@
 est.
+Abstract
 Matcher
-Asser
+Tes
 t.assert
 That
@@ -382,20 +382,24 @@
 t.assert
-That
+NullSafe
 ;%0Aimport
@@ -423,22 +423,49 @@
 est.
-core.IsNot.not
+AbstractMatcherTest.assertUnknownTypeSafe
 ;%0Aim
@@ -529,51 +529,88 @@
 ng;%0A
+%0A
 import 
-static org.junit.Assert.assertEquals
+java.util.ArrayList;%0A%0Aimport org.hamcrest.Matcher;%0Aimport org.junit.Test
 ;%0A%0Ap
@@ -615,16 +615,22 @@
 %0Apublic 
+final 
 class Ev
@@ -643,36 +643,279 @@
 t %7B%0A
-    @Test public void isTrue
+%0A    private final Matcher%3CIterable%3CString%3E%3E matcher = Every.everyItem(containsString(%22a%22));%0A%0A    @Test public void%0A    copesWithNullsAndUnknownTypes() %7B%0A        assertNullSafe(matcher);%0A        assertUnknownTypeSafe(matcher);%0A    %7D%0A%0A    @Test public void%0A    matchesOnly
 When
@@ -923,13 +923,12 @@
 very
-Value
+Item
 Matc
@@ -953,100 +953,131 @@
 sert
-That(asList(%22AaA%22, %22BaB%22, %22CaC%22), Every.everyItem(containsString(%22a%22)));%0A        assertThat(
+Matches(%22didn't match%22, matcher, asList(%22AaA%22, %22BaB%22, %22CaC%22));%0A        assertDoesNotMatch(%22matched unexpectedly%22, matcher, 
 asLi
@@ -1085,68 +1085,25 @@
 t(%22A
-b
+a
 A%22, %22B
-b
+X
 B%22, %22C
-bC%22), not(Every.everyItem(containsString(%22a%22))
+aC%22
 ));%0A
@@ -1134,24 +1134,20 @@
 void
- isAlwaysTrueFor
+%0A    matches
 Empt
@@ -1175,73 +1175,74 @@
 sert
-That(new ArrayList%3CString%3E(), Every.everyItem(contains
+Matches(%22didn't match empty list%22, matcher, new ArrayList%3C
 String
+%3E
 (
-%22a%22)
 ));%0A
@@ -1269,16 +1269,20 @@
 lic void
+%0A   
  describ
@@ -1306,308 +1306,168 @@
     
-final Every%3CString%3E each=  new Every%3CString%3E(containsString(%22a%22));%0A        assertEquals(%22every item is a string containing %5C%22a%5C%22%22, each.toString());%0A        %0A        StringDescription description = new StringDescription(); %0A        each.matchesSafely(asList(%22BbB%22), description);%0A        assertEquals
+assertDescription(%22every item is a string containing %5C%22a%5C%22%22, matcher);%0A    %7D%0A%0A    @Test public void%0A    describesAMismatch() %7B%0A        assertMismatchDescription
 (%22an
@@ -1483,36 +1483,36 @@
  %5C%22B
-b
+X
 B%5C%22%22, 
-description.toString(
+matcher, asList(%22BXB%22
 ));%0A
@@ -1519,8 +1519,9 @@
     %7D%0A%7D%0A
+%0A

convert to JUnit4 test