mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-28 15:02:46 +08:00
style: enable AvoidStarImport
in checkstyle (#5141)
This commit is contained in:
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user