package humaneval.buggy;

// You are given a string s.
// if s[i] is a letter, reverse its case from lower to upper or vise versa,
// otherwise keep it as it is.
// If the string contains no letters, reverse the string.
// The function should return the resulted string.
// Examples
// solve("1234") = "4321"
// solve("ab") = "AB"
// solve("#a@C") = "#A@c"

public class SOLVE_STRING {
    public static String solve_string(String s) {
        int flg = 0;
        StringBuilder sb = new StringBuilder();
        for (char c : s.toCharArray()) {
            if (Character.isLowerCase(c)) sb.append(Character.toUpperCase(c));
            else sb.append(Character.toLowerCase(c));
            flg = 1;
        }
        if (flg == 0) {
            sb = new StringBuilder();
            for (int i = s.length() - 1; i >= 0; i -= 1) sb.append(s.charAt(i));
        }
        return sb.toString();
    }
}

package humaneval;

public class TEST_SOLVE_STRING {
    @org.junit.Test(timeout = 3000)
    public void test_0() throws java.lang.Exception {
        String result = humaneval.buggy.SOLVE_STRING.solve_string("AsDf");
        org.junit.Assert.assertEquals(
            result, "aSdF"
        );
    }

    @org.junit.Test(timeout = 3000)
    public void test_1() throws java.lang.Exception {
        String result = humaneval.buggy.SOLVE_STRING.solve_string("1234");
        org.junit.Assert.assertEquals(
            result, "4321"
        );
    }

    @org.junit.Test(timeout = 3000)
    public void test_2() throws java.lang.Exception {
        String result = humaneval.buggy.SOLVE_STRING.solve_string("ab");
        org.junit.Assert.assertEquals(
            result, "AB"
        );
    }

    @org.junit.Test(timeout = 3000)
    public void test_3() throws java.lang.Exception {
        String result = humaneval.buggy.SOLVE_STRING.solve_string("#a@C");
        org.junit.Assert.assertEquals(
            result, "#A@c"
        );
    }

    @org.junit.Test(timeout = 3000)
    public void test_4() throws java.lang.Exception {
        String result = humaneval.buggy.SOLVE_STRING.solve_string("#AsdfW^45");
        org.junit.Assert.assertEquals(
            result, "#aSDFw^45"
        );
    }

    @org.junit.Test(timeout = 3000)
    public void test_5() throws java.lang.Exception {
        String result = humaneval.buggy.SOLVE_STRING.solve_string("#6@2");
        org.junit.Assert.assertEquals(
            result, "2@6#"
        );
    }

    @org.junit.Test(timeout = 3000)
    public void test_6() throws java.lang.Exception {
        String result = humaneval.buggy.SOLVE_STRING.solve_string("#$a^D");
        org.junit.Assert.assertEquals(
            result, "#$A^d"
        );
    }

    @org.junit.Test(timeout = 3000)
    public void test_7() throws java.lang.Exception {
        String result = humaneval.buggy.SOLVE_STRING.solve_string("#ccc");
        org.junit.Assert.assertEquals(
            result, "#CCC"
        );
    }
}


package humaneval.buggy;

// Given the lengths of the three sides of a triangle. Return True if the three
// sides form a right-angled triangle, False otherwise.
// A right-angled triangle is a triangle in which one angle is right angle or
// 90 degree.
// Example:
// right_angle_triangle(3, 4, 5) == True
// right_angle_triangle(1, 2, 3) == False

public class RIGHT_ANGLE_TRIANGLE {
    public static boolean right_angle_triangle(int a, int b, int c) {
        return a*a + b*b == c*c;
    }
}

package humaneval;

public class TEST_RIGHT_ANGLE_TRIANGLE {
    @org.junit.Test(timeout = 3000)
    public void test_0() throws java.lang.Exception {
        boolean result = humaneval.buggy.RIGHT_ANGLE_TRIANGLE.right_angle_triangle(3, 4, 5);
        org.junit.Assert.assertEquals(
            result, true
        );
    }

    @org.junit.Test(timeout = 3000)
    public void test_1() throws java.lang.Exception {
        boolean result = humaneval.buggy.RIGHT_ANGLE_TRIANGLE.right_angle_triangle(1, 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.RIGHT_ANGLE_TRIANGLE.right_angle_triangle(10, 6, 8);
        org.junit.Assert.assertEquals(
            result, true
        );
    }

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

    @org.junit.Test(timeout = 3000)
    public void test_4() throws java.lang.Exception {
        boolean result = humaneval.buggy.RIGHT_ANGLE_TRIANGLE.right_angle_triangle(7, 24, 25);
        org.junit.Assert.assertEquals(
            result, true
        );
    }

    @org.junit.Test(timeout = 3000)
    public void test_5() throws java.lang.Exception {
        boolean result = humaneval.buggy.RIGHT_ANGLE_TRIANGLE.right_angle_triangle(5, 12, 13);
        org.junit.Assert.assertEquals(
            result, true
        );
    }

    @org.junit.Test(timeout = 3000)
    public void test_6() throws java.lang.Exception {
        boolean result = humaneval.buggy.RIGHT_ANGLE_TRIANGLE.right_angle_triangle(15, 8, 17);
        org.junit.Assert.assertEquals(
            result, true
        );
    }

    @org.junit.Test(timeout = 3000)
    public void test_7() throws java.lang.Exception {
        boolean result = humaneval.buggy.RIGHT_ANGLE_TRIANGLE.right_angle_triangle(48, 55, 73);
        org.junit.Assert.assertEquals(
            result, true
        );
    }

    @org.junit.Test(timeout = 3000)
    public void test_8() throws java.lang.Exception {
        boolean result = humaneval.buggy.RIGHT_ANGLE_TRIANGLE.right_angle_triangle(10, 5, 7);
        org.junit.Assert.assertEquals(
            result, false
        );
    }

    @org.junit.Test(timeout = 3000)
    public void test_9() throws java.lang.Exception {
        boolean result = humaneval.buggy.RIGHT_ANGLE_TRIANGLE.right_angle_triangle(1, 1, 1);
        org.junit.Assert.assertEquals(
            result, false
        );
    }

    @org.junit.Test(timeout = 3000)
    public void test_10() throws java.lang.Exception {
        boolean result = humaneval.buggy.RIGHT_ANGLE_TRIANGLE.right_angle_triangle(2, 2, 10);
        org.junit.Assert.assertEquals(
            result, false
        );
    }
}