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

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.IsNot.not;
import static org.hamcrest.core.IsNull.notNullValue;
import static org.hamcrest.core.IsNull.nullValue;

import java.math.BigDecimal;

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


public class IsNullTest extends AbstractMatcherTest {
    private static final BigDecimal ANY_NON_NULL_ARGUMENT = new BigDecimal(66);

    @Override
    protected Matcher<?> createMatcher() {
        return nullValue();
    }

    public void testEvaluatesToTrueIfArgumentIsNull() {
        assertThat(null, nullValue());
        assertThat(ANY_NON_NULL_ARGUMENT, not(nullValue()));

        assertThat(ANY_NON_NULL_ARGUMENT, notNullValue());
        assertThat(null, not(notNullValue()));
    }

    public void testSupportsStaticTyping() {
        requiresStringMatcher(nullValue(String.class));
        requiresStringMatcher(notNullValue(String.class));
    }

    private void requiresStringMatcher(@SuppressWarnings("unused") Matcher<String> arg) {
        // no-op
    }    
}

@@ -98,28 +98,34 @@
 est.
+Abstract
 Matcher
-Asser
+Tes
 t.assert
 That
@@ -120,20 +120,28 @@
 t.assert
-That
+DoesNotMatch
 ;%0Aimport
@@ -165,74 +165,173 @@
 est.
-core.IsNot.not;%0Aimport static org.hamcrest.core.IsNull.notNullValu
+AbstractMatcherTest.assertMatches;%0Aimport static org.hamcrest.AbstractMatcherTest.assertNullSafe;%0Aimport static org.hamcrest.AbstractMatcherTest.assertUnknownTypeSaf
 e;%0Ai
@@ -369,16 +369,19 @@
 IsNull.n
+otN
 ullValue
@@ -386,36 +386,56 @@
 ue;%0A
-%0A
 import 
-java.math.BigDecimal
+static org.hamcrest.core.IsNull.nullValue
 ;%0A%0Ai
@@ -453,35 +453,23 @@
 amcrest.
-Abstract
 Matcher
-Test
 ;%0Aimport
@@ -473,32 +473,26 @@
 ort org.
-hamcrest.Matcher
+junit.Test
 ;%0A%0A%0Apubl
@@ -494,16 +494,22 @@
 %0Apublic 
+final 
 class Is
@@ -521,201 +521,374 @@
 est 
-extends AbstractMatcherTest %7B%0A    private static final BigDecimal ANY_NON_NULL_ARGUMENT = new BigDecimal(66);%0A%0A    @Override%0A    protected Matcher%3C?%3E createMatcher() %7B%0A        return nullValue(
+%7B%0A%0A    private final Matcher%3CObject%3E nullMatcher = nullValue();%0A    private final Matcher%3CObject%3E notNullMatcher = notNullValue();%0A%0A    @Test public void%0A    copesWithNullsAndUnknownTypes() %7B%0A        assertNullSafe(nullMatcher);%0A        assertUnknownTypeSafe(nullMatcher);%0A        %0A        assertNullSafe(notNullMatcher);%0A        assertUnknownTypeSafe(notNullMatcher
 );%0A 
@@ -889,32 +889,38 @@
 er);%0A    %7D%0A%0A    
+@Test 
 public void test
@@ -918,14 +918,14 @@
 void
- testE
+%0A    e
 valu
@@ -973,198 +973,280 @@
 sert
-That(null, nullValue());%0A        assertThat(ANY_NON_NULL_ARGUMENT, not(nullValue()));%0A%0A        assertThat(ANY_NON_NULL_ARGUMENT, notNullValue());%0A        assertThat(null, not(notNullValue())
+Matches(%22didn't match%22, nullMatcher, null);%0A        assertDoesNotMatch(%22matched unexpectedly%22, nullMatcher, new Object());%0A        %0A        assertMatches(%22didn't match%22, notNullMatcher, new Object());%0A        assertDoesNotMatch(%22matched unexpectedly%22, notNullMatcher, null
 );%0A 
@@ -1250,21 +1250,31 @@
 ;%0A    %7D%0A
+    
 %0A    
+@Test 
 public v
@@ -1280,14 +1280,14 @@
 void
- testS
+%0A    s
 uppo
@@ -1540,15 +1540,11 @@
 op%0A    %7D
-    
 %0A%7D%0A

convert to JUnit4