/*  Copyright (c) 2000-2009 hamcrest.org
 */
package org.hamcrest.core;

import static org.hamcrest.core.IsEqual.equalTo;
import static org.hamcrest.core.IsInstanceOf.instanceOf;
import static org.hamcrest.core.IsNot.not;

import org.hamcrest.AbstractMatcherTest;
import org.hamcrest.Matcher;

public class IsNotTest extends AbstractMatcherTest {
  @Override
  protected Matcher<?> createMatcher() {
    return not("something");
  }

  public void testEvaluatesToTheTheLogicalNegationOfAnotherMatcher() {
    assertMatches("should match", not(equalTo("A")), "B");
    assertDoesNotMatch("should not match", not(equalTo("B")), "B");
  }

  public void testProvidesConvenientShortcutForNotEqualTo() {
    assertMatches("should match", not("A"), "B");
    assertMatches("should match", not("B"), "A");
    assertDoesNotMatch("should not match", not("A"), "A");
    assertDoesNotMatch("should not match", not("B"), "B");
  }

  public void testUsesDescriptionOfNegatedMatcherWithPrefix() {
    assertDescription("not an instance of java.lang.String", not(instanceOf(String.class)));
    assertDescription("not \"A\"", not("A"));
  }
 }

@@ -66,16 +66,344 @@
 .core;%0A%0A
+import static org.hamcrest.AbstractMatcherTest.assertDescription;%0Aimport static org.hamcrest.AbstractMatcherTest.assertDoesNotMatch;%0Aimport static org.hamcrest.AbstractMatcherTest.assertMatches;%0Aimport static org.hamcrest.AbstractMatcherTest.assertNullSafe;%0Aimport static org.hamcrest.AbstractMatcherTest.assertUnknownTypeSafe;%0A
 import s
@@ -564,35 +564,23 @@
 amcrest.
-Abstract
 Matcher
-Test
 ;%0Aimport
@@ -584,32 +584,26 @@
 ort org.
-hamcrest.Matcher
+junit.Test
 ;%0A%0Apubli
@@ -604,16 +604,22 @@
 %0Apublic 
+final 
 class Is
@@ -630,127 +630,214 @@
 est 
-extends AbstractMatcherTest %7B%0A  @Overr
+%7B%0A%0A    @Test public vo
 id
-e
 %0A  
-protected Matcher%3C?%3E createMatcher() %7B%0A    return not(%22something%22
+  copesWithNullsAndUnknownTypes() %7B%0A        Matcher%3CString%3E matcher = not(%22something%22);%0A%0A        assertNullSafe(matcher);%0A        assertUnknownTypeSafe(matcher
 );%0A
+  
   %7D%0A%0A  
+  @Test 
 publ
@@ -847,14 +847,14 @@
 void
- testE
+%0A    e
 valu
@@ -909,37 +909,43 @@
     
-assertMatches(%22should
+    final Matcher%3CString%3E
  match
-%22,
+er =
  not
@@ -958,24 +958,72 @@
 To(%22A%22))
+;%0A%0A        assertMatches(%22didn't match%22, matcher
 , %22B%22);%0A
     asse
@@ -1006,32 +1006,36 @@
  matcher, %22B%22);%0A
+    
     assertDoesNo
@@ -1046,59 +1046,63 @@
 ch(%22
-should not match%22, not(equalTo(%22B%22)), %22B
+matched unexpectedly%22, matcher, %22A
 %22);%0A
+  
   %7D%0A%0A  
+  @Test 
 publ
@@ -1112,14 +1112,14 @@
 void
- testP
+%0A    p
 rovi
@@ -1165,37 +1165,43 @@
     
-assertMatches(%22should
+    final Matcher%3CString%3E
  match
-%22,
+er =
  not
@@ -1205,24 +1205,23 @@
 not(%22A%22)
-, %22B%22);%0A
+;%0A%0A    
     asse
@@ -1231,22 +1231,22 @@
 atches(%22
-should
+didn't
  match%22,
@@ -1250,24 +1250,27 @@
 h%22, 
-not(%22B%22), %22A
+matcher, %22B
 %22);%0A
+    
     
@@ -1293,109 +1293,63 @@
 ch(%22
-should not match%22, not(%22A%22), %22A%22);%0A    assertDoesNotMatch(%22should not match%22, not(%22B%22), %22B
+matched unexpectedly%22, matcher, %22A
 %22);%0A
+  
   %7D%0A%0A  
+  @Test 
 publ
@@ -1359,14 +1359,14 @@
 void
- testU
+%0A    u
 sesD
@@ -1402,24 +1402,28 @@
 hPrefix() %7B%0A
+    
     assertDe
@@ -1503,16 +1503,20 @@
 ass)));%0A
+    
     asse
@@ -1557,11 +1557,12 @@
 ));%0A
+  
   %7D%0A
- 
 %7D%0A

convert test to JUnit4