<commit_before>package cz.voho.jequal;

import cz.voho.jequal.beans.Employee;
import cz.voho.jequal.beans.Person;
import org.junit.Test;

public class PersonEqualityTest extends AbstractEqualityTest {
    private static final Equality<Person> EQUALITY_ON_NAME_WITH_SUB_TYPES = Equality
            .ofClass(Person.class)
            .orAnySubClass()
            .checkEquals(Person::getFirstName)
            .checkEquals(Person::getLastName)
            .define();

    private static final Equality<Person> EQUALITY_ON_NAME_WITHOUT_SUB_TYPES = Equality
            .ofClass(Person.class)
            .checkEquals(Person::getFirstName)
            .checkEquals(Person::getLastName)
            .define();

    @Test
    public void testNotEqualToNull() {
        Person p1 = new Person();
        p1.setFirstName("John");
        p1.setLastName("Doe");

        Object p2 = null;

        assertNotEqualsThoroughly(p1, p2, EQUALITY_ON_NAME_WITHOUT_SUB_TYPES, EQUALITY_ON_NAME_WITH_SUB_TYPES);
    }

    @Test<commit_msg>added more tests for 100% coverage<commit_after>package cz.voho.jequal;

import cz.voho.jequal.beans.Employee;
import cz.voho.jequal.beans.Person;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class PersonEqualityTest extends AbstractEqualityTest {
    private static final Equality<Person> EQUALITY_ON_NAME_WITH_SUB_TYPES = Equality
            .ofClass(Person.class)
            .orAnySubClass()
            .checkEquals(Person::getFirstName)
            .checkEquals(Person::getLastName)
            .define();

    private static final Equality<Person> EQUALITY_ON_NAME_WITHOUT_SUB_TYPES = Equality
            .ofClass(Person.class)
            .checkEquals(Person::getFirstName)
            .checkEquals(Person::getLastName)
            .define();

    @Test
    public void testNullHashCode() {
        assertEquals(0, EQUALITY_ON_NAME_WITH_SUB_TYPES.hashCode(null));
        assertEquals(0, EQUALITY_ON_NAME_WITHOUT_SUB_TYPES.hashCode(null));
    }

    @Test
    public void testNotEqualToNull() {
        Person p1 = new Person();
        p1.setFirstName("John");
        p1.setLastName("Doe");

        Object p2 = null;

        assertNotEqualsThoroughly(p1, p2, EQUALITY_ON_NAME_WITHOUT_SUB_TYPES, EQUALITY_ON_NAME_WITH_SUB_TYPES);
    }

    @Test
{'fraction_non_alphanumeric': 0.09248055315471046, 'fraction_numerical': 0.007346585998271392, 'mean_word_length': 3.0051903114186853, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '525679', 'n_tokens_mistral': 758, 'n_tokens_neox': 734, 'n_words': 119}