mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-08-01 18:49:39 +08:00
style: enable AvoidStarImport
in checkstyle (#5141)
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
package com.thealgorithms.maths;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertAll;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.thealgorithms.maths;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.thealgorithms.maths;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertIterableEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
import java.util.List;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.thealgorithms.maths;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.thealgorithms.maths;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.thealgorithms.maths;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.thealgorithms.maths;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.thealgorithms.maths;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import java.util.List;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.thealgorithms.maths;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.thealgorithms.maths;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.thealgorithms.maths;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashSet;
|
||||
|
@ -1,30 +1,30 @@
|
||||
package com.thealgorithms.maths;
|
||||
|
||||
import static com.thealgorithms.maths.MillerRabinPrimalityCheck.*;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class MillerRabinPrimalityCheckTest {
|
||||
@Test
|
||||
void testDeterministicMillerRabinForPrimes() {
|
||||
assertTrue(deterministicMillerRabin(2));
|
||||
assertTrue(deterministicMillerRabin(37));
|
||||
assertTrue(deterministicMillerRabin(123457));
|
||||
assertTrue(deterministicMillerRabin(6472601713L));
|
||||
assertTrue(MillerRabinPrimalityCheck.deterministicMillerRabin(2));
|
||||
assertTrue(MillerRabinPrimalityCheck.deterministicMillerRabin(37));
|
||||
assertTrue(MillerRabinPrimalityCheck.deterministicMillerRabin(123457));
|
||||
assertTrue(MillerRabinPrimalityCheck.deterministicMillerRabin(6472601713L));
|
||||
}
|
||||
@Test
|
||||
void testDeterministicMillerRabinForNotPrimes() {
|
||||
assertFalse(deterministicMillerRabin(1));
|
||||
assertFalse(deterministicMillerRabin(35));
|
||||
assertFalse(deterministicMillerRabin(123453));
|
||||
assertFalse(deterministicMillerRabin(647260175));
|
||||
assertFalse(MillerRabinPrimalityCheck.deterministicMillerRabin(1));
|
||||
assertFalse(MillerRabinPrimalityCheck.deterministicMillerRabin(35));
|
||||
assertFalse(MillerRabinPrimalityCheck.deterministicMillerRabin(123453));
|
||||
assertFalse(MillerRabinPrimalityCheck.deterministicMillerRabin(647260175));
|
||||
}
|
||||
@Test
|
||||
void testMillerRabinForPrimes() {
|
||||
assertTrue(millerRabin(11, 5));
|
||||
assertTrue(millerRabin(97, 5));
|
||||
assertTrue(millerRabin(6720589, 5));
|
||||
assertTrue(millerRabin(9549401549L, 5));
|
||||
assertTrue(MillerRabinPrimalityCheck.millerRabin(11, 5));
|
||||
assertTrue(MillerRabinPrimalityCheck.millerRabin(97, 5));
|
||||
assertTrue(MillerRabinPrimalityCheck.millerRabin(6720589, 5));
|
||||
assertTrue(MillerRabinPrimalityCheck.millerRabin(9549401549L, 5));
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.thealgorithms.maths;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.thealgorithms.maths;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.thealgorithms.maths;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.thealgorithms.maths;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.thealgorithms.maths;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import java.util.List;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.thealgorithms.maths;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.thealgorithms.maths;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.thealgorithms.maths;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
|
Reference in New Issue
Block a user