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,8 +1,8 @@
package com.thealgorithms.backtracking;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertIterableEquals;
import java.util.*;
import java.util.List;
import org.junit.jupiter.api.Test;
public class AllPathsFromSourceToTargetTest {

View File

@ -1,6 +1,7 @@
package com.thealgorithms.backtracking;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import java.util.List;
import java.util.TreeSet;

View File

@ -1,6 +1,6 @@
package com.thealgorithms.backtracking;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.List;
import java.util.TreeSet;

View File

@ -1,8 +1,8 @@
package com.thealgorithms.backtracking;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.*;
import java.util.ArrayList;
import org.junit.jupiter.api.Test;
/**

View File

@ -1,6 +1,6 @@
package com.thealgorithms.backtracking;
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.backtracking;
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.Arrays;
import java.util.List;

View File

@ -1,6 +1,8 @@
package com.thealgorithms.bitmanipulation;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertThrows;
import org.junit.jupiter.api.Test;

View File

@ -1,6 +1,6 @@
package com.thealgorithms.bitmanipulation;
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.bitmanipulation;
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.bitmanipulation;
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.bitmanipulation;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;

View File

@ -5,7 +5,8 @@ package com.thealgorithms.bitmanipulation;
* @author Bama Charan Chhandogi
*/
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.bitmanipulation;
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.ciphers;
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.ciphers;
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.ciphers;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

View File

@ -1,6 +1,6 @@
package com.thealgorithms.ciphers;
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.conversions;
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.conversions;
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.conversions;
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.conversions;
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.conversions;
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.conversions;
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.conversions;
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.conversions;
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.conversions;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;

View File

@ -1,11 +1,18 @@
package com.thealgorithms.datastructures.buffers;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.concurrent.*;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicIntegerArray;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.RepeatedTest;

View File

@ -1,6 +1,8 @@
package com.thealgorithms.datastructures.crdt;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
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.datastructures.crdt;
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.datastructures.crdt;
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.BeforeEach;
import org.junit.jupiter.api.Test;

View File

@ -1,6 +1,8 @@
package com.thealgorithms.datastructures.crdt;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.Set;
import org.junit.jupiter.api.Test;

View File

@ -1,6 +1,8 @@
package com.thealgorithms.datastructures.crdt;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
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.datastructures.crdt;
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.BeforeEach;
import org.junit.jupiter.api.Test;

View File

@ -1,6 +1,8 @@
package com.thealgorithms.datastructures.graphs;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import com.thealgorithms.datastructures.graphs.BoruvkaAlgorithm.Graph;
import java.util.ArrayList;

View File

@ -1,6 +1,6 @@
package com.thealgorithms.datastructures.graphs;
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,9 @@
package com.thealgorithms.datastructures.hashmap;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import com.thealgorithms.datastructures.hashmap.hashing.HashMapCuckooHashing;
import org.junit.jupiter.api.Test;

View File

@ -1,6 +1,9 @@
package com.thealgorithms.datastructures.hashmap.hashing;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Test;

View File

@ -1,6 +1,9 @@
package com.thealgorithms.datastructures.hashmap.hashing;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Test;

View File

@ -1,6 +1,6 @@
package com.thealgorithms.datastructures.hashmap.hashing;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.ArrayList;
import java.util.Collections;

View File

@ -1,6 +1,9 @@
package com.thealgorithms.datastructures.hashmap.hashing;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.Random;
import org.junit.jupiter.api.Test;

View File

@ -6,7 +6,8 @@ package com.thealgorithms.datastructures.lists;
* GitHub: https://github.com/Prabhat-Kumar-42
*/
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import org.junit.jupiter.api.Test;

View File

@ -5,7 +5,8 @@ package com.thealgorithms.datastructures.lists;
* Author: Bama Charan Chhandogi (https://github.com/BamaCharanChhandogi)
*/
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import org.junit.jupiter.api.Test;

View File

@ -5,7 +5,8 @@ package com.thealgorithms.datastructures.lists;
* Author: Bama Charan Chhandogi (https://github.com/BamaCharanChhandogi)
*/
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import org.junit.jupiter.api.Test;

View File

@ -1,6 +1,9 @@
package com.thealgorithms.datastructures.lists;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.ArrayList;
import java.util.Arrays;

View File

@ -1,8 +1,10 @@
package com.thealgorithms.datastructures.lists;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.*;
import java.util.Arrays;
import java.util.stream.IntStream;
import org.junit.jupiter.api.Test;

View File

@ -1,6 +1,6 @@
package com.thealgorithms.datastructures.trees;
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.divideandconquer;
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.divideandconquer;
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,6 @@
package com.thealgorithms.dynamicprogramming;
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.dynamicprogramming;
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.dynamicprogramming;
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.dynamicprogramming;
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,5 +1,6 @@
package com.thealgorithms.dynamicprogramming;
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.greedyalgorithms;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.ArrayList;
import java.util.Arrays;

View File

@ -1,6 +1,6 @@
package com.thealgorithms.greedyalgorithms;
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.greedyalgorithms;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.ArrayList;
import java.util.Collections;

View File

@ -1,6 +1,6 @@
package com.thealgorithms.io;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.io.ByteArrayInputStream;
import java.io.IOException;

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;

View File

@ -1,6 +1,6 @@
package com.thealgorithms.misc;
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.misc;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.ArrayList;
import java.util.Arrays;

View File

@ -1,6 +1,6 @@
package com.thealgorithms.others;
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,6 @@
package com.thealgorithms.others;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.ArrayList;
import java.util.Arrays;

View File

@ -1,6 +1,6 @@
package com.thealgorithms.others;
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.others;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertTrue;
import com.thealgorithms.dynamicprogramming.CountFriendsPairing;
import org.junit.jupiter.api.Test;

View File

@ -1,6 +1,6 @@
package com.thealgorithms.others;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.ArrayList;
import java.util.Arrays;

View File

@ -1,6 +1,6 @@
package com.thealgorithms.others;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertTrue;
import com.thealgorithms.dynamicprogramming.KadaneAlgorithm;
import org.junit.jupiter.api.Test;

View File

@ -1,5 +1,7 @@
package com.thealgorithms.others;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Test;
public class LineSweepTest {

View File

@ -1,6 +1,6 @@
package com.thealgorithms.others;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertTrue;
import com.thealgorithms.sorts.LinkListSort;
import org.junit.jupiter.api.Test;

View File

@ -1,6 +1,6 @@
package com.thealgorithms.others;
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.others;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertTrue;
import com.thealgorithms.dynamicprogramming.NewManShanksPrime;
import org.junit.jupiter.api.Test;

View File

@ -1,6 +1,6 @@
package com.thealgorithms.others;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.ArrayList;
import java.util.Arrays;

View File

@ -1,6 +1,7 @@
package com.thealgorithms.others;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Test;

View File

@ -1,26 +1,26 @@
package com.thealgorithms.others;
import static org.junit.jupiter.api.Assertions.*;
import java.util.List;
import org.junit.jupiter.api.Test;
public class TestPrintMatrixInSpiralOrder {
@Test
public void testOne() {
int[][] matrix = {{3, 4, 5, 6, 7}, {8, 9, 10, 11, 12}, {14, 15, 16, 17, 18}, {23, 24, 25, 26, 27}, {30, 31, 32, 33, 34}};
var printClass = new PrintAMatrixInSpiralOrder();
List<Integer> res = printClass.print(matrix, matrix.length, matrix[0].length);
List<Integer> list = List.of(3, 4, 5, 6, 7, 12, 18, 27, 34, 33, 32, 31, 30, 23, 14, 8, 9, 10, 11, 17, 26, 25, 24, 15, 16);
assertIterableEquals(res, list);
}
@Test
public void testTwo() {
int[][] matrix = {{2, 2}};
var printClass = new PrintAMatrixInSpiralOrder();
List<Integer> res = printClass.print(matrix, matrix.length, matrix[0].length);
List<Integer> list = List.of(2, 2);
assertIterableEquals(res, list);
}
}
package com.thealgorithms.others;
import static org.junit.jupiter.api.Assertions.assertIterableEquals;
import java.util.List;
import org.junit.jupiter.api.Test;
public class TestPrintMatrixInSpiralOrder {
@Test
public void testOne() {
int[][] matrix = {{3, 4, 5, 6, 7}, {8, 9, 10, 11, 12}, {14, 15, 16, 17, 18}, {23, 24, 25, 26, 27}, {30, 31, 32, 33, 34}};
var printClass = new PrintAMatrixInSpiralOrder();
List<Integer> res = printClass.print(matrix, matrix.length, matrix[0].length);
List<Integer> list = List.of(3, 4, 5, 6, 7, 12, 18, 27, 34, 33, 32, 31, 30, 23, 14, 8, 9, 10, 11, 17, 26, 25, 24, 15, 16);
assertIterableEquals(res, list);
}
@Test
public void testTwo() {
int[][] matrix = {{2, 2}};
var printClass = new PrintAMatrixInSpiralOrder();
List<Integer> res = printClass.print(matrix, matrix.length, matrix[0].length);
List<Integer> list = List.of(2, 2);
assertIterableEquals(res, list);
}
}

View File

@ -1,6 +1,6 @@
package com.thealgorithms.others;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.ArrayList;
import java.util.Arrays;

View File

@ -5,9 +5,11 @@ package com.thealgorithms.scheduling;
* @author [Bama Charan Chhandogi](https://www.github.com/BamaCharanChhandogi)
*/
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.junit.jupiter.api.Test;
class PreemptivePrioritySchedulingTest {

View File

@ -1,6 +1,6 @@
package com.thealgorithms.scheduling;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import com.thealgorithms.devutils.entities.ProcessDetails;
import java.util.ArrayList;

View File

@ -1,6 +1,7 @@
package com.thealgorithms.scheduling;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import com.thealgorithms.devutils.entities.ProcessDetails;
import java.util.ArrayList;

View File

@ -3,7 +3,7 @@ package com.thealgorithms.searches;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import java.util.*;
import java.util.Arrays;
import org.junit.jupiter.api.Test;
public class BinarySearch2dArrayTest {

View File

@ -1,6 +1,8 @@
package com.thealgorithms.searches;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import com.thealgorithms.datastructures.Node;
import java.util.List;

View File

@ -1,6 +1,8 @@
package com.thealgorithms.searches;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import com.thealgorithms.datastructures.Node;
import java.util.List;

View File

@ -1,6 +1,6 @@
package com.thealgorithms.searches;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;

Some files were not shown because too many files have changed in this diff Show More