package humaneval.buggy;

/* Create a function that takes 3 numbers.
Returns true if one of the numbers is equal to the sum of the other two, and all numbers (double) can be converted integers.
Returns false in any other cases.

Examples
any_int(5, 2, 7) ➞ True

any_int(3, 2, 2) ➞ False

any_int(3, -2, 1) ➞ True

any_int(3.6, -2.2, 2) ➞ False */

public class ANY_INT {
    public static boolean any_int(double x, double y, double z) {
        if ((int)x == x && (int)y == y) {
            if (x + y == z || x + z == y)
                return true;
        }
        return false;
    }
}

package humaneval;

public class TEST_ANY_INT {
    @org.junit.Test(timeout = 3000)
    public void test_0() throws java.lang.Exception {
        boolean result = humaneval.buggy.ANY_INT.any_int(2, 3, 1);
        org.junit.Assert.assertEquals(
            result, true
        );
    }

    @org.junit.Test(timeout = 3000)
    public void test_1() throws java.lang.Exception {
        boolean result = humaneval.buggy.ANY_INT.any_int(2.5, 2, 3);
        org.junit.Assert.assertEquals(
            result, false
        );
    }

    @org.junit.Test(timeout = 3000)
    public void test_2() throws java.lang.Exception {
        boolean result = humaneval.buggy.ANY_INT.any_int(1.5, 5, 3.5);
        org.junit.Assert.assertEquals(
            result, false
        );
    }

    @org.junit.Test(timeout = 3000)
    public void test_3() throws java.lang.Exception {
        boolean result = humaneval.buggy.ANY_INT.any_int(2, 6, 2);
        org.junit.Assert.assertEquals(
            result, false
        );
    }

    @org.junit.Test(timeout = 3000)
    public void test_4() throws java.lang.Exception {
        boolean result = humaneval.buggy.ANY_INT.any_int(4, 2, 2);
        org.junit.Assert.assertEquals(
            result, true
        );
    }

    @org.junit.Test(timeout = 3000)
    public void test_5() throws java.lang.Exception {
        boolean result = humaneval.buggy.ANY_INT.any_int(2.2, 2.2, 2.2);
        org.junit.Assert.assertEquals(
            result, false
        );
    }

    @org.junit.Test(timeout = 3000)
    public void test_6() throws java.lang.Exception {
        boolean result = humaneval.buggy.ANY_INT.any_int(-4, 6, 2);
        org.junit.Assert.assertEquals(
            result, true
        );
    }

    @org.junit.Test(timeout = 3000)
    public void test_7() throws java.lang.Exception {
        boolean result = humaneval.buggy.ANY_INT.any_int(2, 1, 1);
        org.junit.Assert.assertEquals(
            result, true
        );
    }

    @org.junit.Test(timeout = 3000)
    public void test_8() throws java.lang.Exception {
        boolean result = humaneval.buggy.ANY_INT.any_int(3, 4, 7);
        org.junit.Assert.assertEquals(
            result, true
        );
    }
}