style: enable AvoidStarImport in checkstyle (#5141)

This commit is contained in:
Piotr Idzik
2024-05-05 20:48:56 +02:00
committed by GitHub
parent dc47e0aa42
commit 414835db11
188 changed files with 479 additions and 310 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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));
}
}

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;