3 import static org.testng.Assert.assertEquals;
5 import org.testng.annotations.Test;
7 public class MathUtilsTest
9 @Test(groups = "Functional")
12 assertEquals(MathUtils.gcd(0, 0), 0);
13 assertEquals(MathUtils.gcd(0, 1), 1);
14 assertEquals(MathUtils.gcd(1, 0), 1);
15 assertEquals(MathUtils.gcd(1, 1), 1);
16 assertEquals(MathUtils.gcd(1, -1), 1);
17 assertEquals(MathUtils.gcd(-1, 1), 1);
18 assertEquals(MathUtils.gcd(2, 3), 1);
19 assertEquals(MathUtils.gcd(4, 2), 2);
20 assertEquals(MathUtils.gcd(2, 4), 2);
21 assertEquals(MathUtils.gcd(2, -4), 2);
22 assertEquals(MathUtils.gcd(-2, 4), 2);
23 assertEquals(MathUtils.gcd(-2, -4), 2);
24 assertEquals(MathUtils.gcd(2 * 3 * 5 * 7 * 11, 3 * 7 * 13 * 17), 3 * 7);