<commit_before>/*  Copyright (c) 2000-2006 hamcrest.org
 */
package org.hamcrest;

import org.hamcrest.core.And;
import org.hamcrest.core.IsAnything;
import org.hamcrest.core.IsCompatibleType;
import org.hamcrest.core.IsEqual;
import org.hamcrest.core.IsIn;
import org.hamcrest.core.IsInstanceOf;
import org.hamcrest.core.IsNot;
import org.hamcrest.core.IsNull;
import org.hamcrest.core.Or;
import org.hamcrest.internal.StringDescription;

import java.util.Collection;

public class Matchers {

    public static final Matcher ANYTHING = new IsAnything();
    public static final Matcher NULL = new IsNull();
    public static final Matcher NOT_NULL = new IsNot(NULL);
    public static final Matcher IS_TRUE = new IsEqual(Boolean.TRUE);
    public static final Matcher IS_FALSE = new IsEqual(Boolean.FALSE);

    public static <T> void assertThat(T value, Matcher<T> isMatchedBy) {
        if (!isMatchedBy.match(value)) {
            Description description = new StringDescription();
            description.appendText("\nExpected: ");
            isMatchedBy.describeTo(description);
            description.appendText("\n    got : ").appendValue(value).appendText("\n");
            throw new AssertionError(description.toString());
        }
    }

    public static IsEqual eq(Object operand) {
        return new IsEqual(operand);
    }

    public static IsEqual eq(boolean operand) {
        // Avoid newing Boolean objects.
        // Boolean.valueOf() not available on JDK 1.3.
        return eq(operand ? Boolean.TRUE : Boolean.FALSE);
    }

    public static IsEqual eq(byte operand) {
        return eq(new Byte(operand));
    }

    public static IsEqual eq(short operand) {
        return eq(new Short(operand));
    }

    public static IsEqual eq(char operand) {
        return eq(new Character(operand));
    }

    public static IsEqual eq(int operand) {
        return eq(new Integer(operand));
    }

    public static IsEqual eq(long operand) {
        return eq(new Long(operand));
    }

    public static IsEqual eq(float operand) {
        return eq(new Float(operand));
    }

    public static IsEqual eq(double operand) {
        return eq(new Double(operand));
    }

    public static IsInstanceOf isA(Class operandClass) {
        return new IsInstanceOf(operandClass);
    }

    public static <T> Matcher<T> not(Matcher<T> c) {
        return new IsNot<T>(c);
    }

    public static <T> Matcher<T> and(Matcher<T> left, Matcher<T> right) {
        return new And<T>(left, right);
    }

    public static <T> Matcher<T> or(Matcher<T> left, Matcher<T> right) {
        return new Or<T>(left, right);
    }

    public static IsCompatibleType compatibleType(Class baseType) {
        return new IsCompatibleType(baseType);
    }

    public static IsIn isIn(Collection collection) {<commit_msg>Deleted redundant matchers (not required with Java5).<commit_after>/*  Copyright (c) 2000-2006 hamcrest.org
 */
package org.hamcrest;

import org.hamcrest.core.And;
import org.hamcrest.core.IsAnything;
import org.hamcrest.core.IsCompatibleType;
import org.hamcrest.core.IsEqual;
import org.hamcrest.core.IsIn;
import org.hamcrest.core.IsInstanceOf;
import org.hamcrest.core.IsNot;
import org.hamcrest.core.IsNull;
import org.hamcrest.core.Or;
import org.hamcrest.internal.StringDescription;

import java.util.Collection;

public class Matchers {

    public static final Matcher ANYTHING = new IsAnything();
    public static final Matcher NULL = new IsNull();
    public static final Matcher NOT_NULL = new IsNot(NULL);
    public static final Matcher IS_TRUE = new IsEqual(Boolean.TRUE);
    public static final Matcher IS_FALSE = new IsEqual(Boolean.FALSE);

    public static <T> void assertThat(T value, Matcher<T> isMatchedBy) {
        if (!isMatchedBy.match(value)) {
            Description description = new StringDescription();
            description.appendText("\nExpected: ");
            isMatchedBy.describeTo(description);
            description.appendText("\n    got : ").appendValue(value).appendText("\n");
            throw new AssertionError(description.toString());
        }
    }

    public static IsEqual eq(Object operand) {
        return new IsEqual(operand);
    }

    public static IsInstanceOf isA(Class operandClass) {
        return new IsInstanceOf(operandClass);
    }

    public static <T> Matcher<T> not(Matcher<T> c) {
        return new IsNot<T>(c);
    }

    public static <T> Matcher<T> and(Matcher<T> left, Matcher<T> right) {
        return new And<T>(left, right);
    }

    public static <T> Matcher<T> or(Matcher<T> left, Matcher<T> right) {
        return new Or<T>(left, right);
    }

    public static IsCompatibleType compatibleType(Class baseType) {
        return new IsCompatibleType(baseType);
    }

    public static IsIn isIn(Collection collection) {
{'fraction_non_alphanumeric': 0.10546955624355005, 'fraction_numerical': 0.00392156862745098, 'mean_word_length': 3.181190681622088, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4137766', 'n_tokens_mistral': 1485, 'n_tokens_neox': 1451, 'n_words': 383}