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

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

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;

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;

View File

@ -1,8 +1,13 @@
package com.thealgorithms.searches;
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.*;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Random;
import java.util.stream.Collectors;
import org.junit.jupiter.api.Test;

View File

@ -3,7 +3,7 @@
// Test file updated with JUnit tests
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; // Import the JUnit 5 Test annotation

View File

@ -1,27 +1,27 @@
package com.thealgorithms.searches;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;
public class TestSearchInARowAndColWiseSortedMatrix {
@Test
public void searchItem() {
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 test = new SearchInARowAndColWiseSortedMatrix();
int[] res = test.search(matrix, 16);
int[] expectedResult = {2, 2};
assertArrayEquals(expectedResult, res);
}
@Test
public void notFound() {
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 test = new SearchInARowAndColWiseSortedMatrix();
int[] res = test.search(matrix, 96);
int[] expectedResult = {-1, -1};
assertArrayEquals(expectedResult, res);
}
}
package com.thealgorithms.searches;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import org.junit.jupiter.api.Test;
public class TestSearchInARowAndColWiseSortedMatrix {
@Test
public void searchItem() {
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 test = new SearchInARowAndColWiseSortedMatrix();
int[] res = test.search(matrix, 16);
int[] expectedResult = {2, 2};
assertArrayEquals(expectedResult, res);
}
@Test
public void notFound() {
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 test = new SearchInARowAndColWiseSortedMatrix();
int[] res = test.search(matrix, 96);
int[] expectedResult = {-1, -1};
assertArrayEquals(expectedResult, res);
}
}