Repository: TheAlgorithms/Java
Pull request #5833 (2024-10-14 20:20:11)

style: include `OCP_OVERLY_CONCRETE_PARAMETER`
<!--
Thank you for your contribution!
In order to reduce the number of notifications sent to the maintainers, please:
- create your PR as draft, cf. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests#draft-pull-requests,
- make sure that all of the CI checks pass,
- mark your PR as ready for review, cf. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request#marking-a-pull-request-as-ready-for-review
-->

Continuation of #5126.

<!-- For completed items, change [ ] to [x] -->

- [x] I have read [CONTRIBUTING.md](https://github.com/TheAlgorithms/Java/blob/master/CONTRIBUTING.md).
- [x] This pull request is all my own work -- I have not plagiarized it.
- [x] All filenames are in PascalCase.
- [x] All functions and variable names follow Java naming conventions.
- [x] All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.
- [x] All new code is formatted with `clang-format -i --style=file path/to/your/file.java`

codecov-commenter: ## [Codecov](https://app.codecov.io/gh/TheAlgorithms/Java/pull/5833?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheAlgorithms) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 65.96%. Comparing base [(`3af4cfd`)](https://app.codecov.io/gh/TheAlgorithms/Java/commit/3af4cfd7c8e83df8f7018d802c61f9c22296e729?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheAlgorithms) to head [(`95f6ecc`)](https://app.codecov.io/gh/TheAlgorithms/Java/commit/95f6eccdcfbc11ff54d93633389400f8e17f9f85?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheAlgorithms).

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff            @@
##             master    #5833   +/-   ##
=========================================
  Coverage     65.96%   65.96%           
- Complexity     4386     4387    +1     
=========================================
  Files           602      602           
  Lines         16783    16783           
  Branches       3226     3226           
=========================================
  Hits          11071    11071           
  Misses         5266     5266           
  Partials        446      446           
```

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/TheAlgorithms/Java/pull/5833?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheAlgorithms).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheAlgorithms).


Patch:
diff --git a/spotbugs-exclude.xml b/spotbugs-exclude.xml
index bfc77167..14bc5dfe 100644
--- a/spotbugs-exclude.xml
+++ b/spotbugs-exclude.xml
@@ -87,9 +87,6 @@
         <Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE" />
     </Match>
     <!-- fb-contrib -->
-    <Match>
-        <Bug pattern="OCP_OVERLY_CONCRETE_PARAMETER" />
-    </Match>
     <Match>
         <Bug pattern="LSC_LITERAL_STRING_COMPARISON" />
     </Match>
diff --git a/src/main/java/com/thealgorithms/backtracking/CrosswordSolver.java b/src/main/java/com/thealgorithms/backtracking/CrosswordSolver.java
index cbd9f70f..6bfb026c 100644
--- a/src/main/java/com/thealgorithms/backtracking/CrosswordSolver.java
+++ b/src/main/java/com/thealgorithms/backtracking/CrosswordSolver.java
@@ -1,6 +1,7 @@
 package com.thealgorithms.backtracking;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.List;
 
 /**
@@ -95,7 +96,7 @@ public final class CrosswordSolver {
      * @param words  The list of words to be placed.
      * @return true if the crossword is solved, false otherwise.
      */
-    public static boolean solveCrossword(char[][] puzzle, List<String> words) {
+    public static boolean solveCrossword(char[][] puzzle, Collection<String> words) {
         // Create a mutable copy of the words list
         List<String> remainingWords = new ArrayList<>(words);
 
diff --git a/src/main/java/com/thealgorithms/datastructures/graphs/AStar.java b/src/main/java/com/thealgorithms/datastructures/graphs/AStar.java
index 460c05e0..741caa59 100644
--- a/src/main/java/com/thealgorithms/datastructures/graphs/AStar.java
+++ b/src/main/java/com/thealgorithms/datastructures/graphs/AStar.java
@@ -94,7 +94,7 @@ public final class AStar {
     }
 
     // Initializes the graph with edges defined in the input data
-    static void initializeGraph(Graph graph, ArrayList<Integer> data) {
+    static void initializeGraph(Graph graph, List<Integer> data) {
         for (int i = 0; i < data.size(); i += 4) {
             graph.addEdge(new Edge(data.get(i), data.get(i + 1), data.get(i + 2)));
         }
diff --git a/src/main/java/com/thealgorithms/datastructures/graphs/EdmondsBlossomAlgorithm.java b/src/main/java/com/thealgorithms/datastructures/graphs/EdmondsBlossomAlgorithm.java
index 27ad96d7..db716580 100644
--- a/src/main/java/com/thealgorithms/datastructures/graphs/EdmondsBlossomAlgorithm.java
+++ b/src/main/java/com/thealgorithms/datastructures/graphs/EdmondsBlossomAlgorithm.java
@@ -30,7 +30,7 @@ public final class EdmondsBlossomAlgorithm {
      * @param vertexCount The number of vertices in the graph.
      * @return A list of matched pairs of vertices.
      */
-    public static List<int[]> maximumMatching(List<int[]> edges, int vertexCount) {
+    public static List<int[]> maximumMatching(Iterable<int[]> edges, int vertexCount) {
         List<List<Integer>> graph = new ArrayList<>(vertexCount);
 
         // Initialize each vertex's adjacency list.
diff --git a/src/main/java/com/thealgorithms/datastructures/lists/MergeSortedArrayList.java b/src/main/java/com/thealgorithms/datastructures/lists/MergeSortedArrayList.java
index 99ab09f8..e315c423 100644
--- a/src/main/java/com/thealgorithms/datastructures/lists/MergeSortedArrayList.java
+++ b/src/main/java/com/thealgorithms/datastructures/lists/MergeSortedArrayList.java
@@ -1,6 +1,7 @@
 package com.thealgorithms.datastructures.lists;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.List;
 
 /**
@@ -38,7 +39,7 @@ public final class MergeSortedArrayList {
      * @param listB the second list to merge
      * @param listC the result list after merging
      */
-    public static void merge(List<Integer> listA, List<Integer> listB, List<Integer> listC) {
+    public static void merge(List<Integer> listA, List<Integer> listB, Collection<Integer> listC) {
         int pa = 0;
         /* the index of listA */
         int pb = 0;
diff --git a/src/main/java/com/thealgorithms/geometry/ConvexHull.java b/src/main/java/com/thealgorithms/geometry/ConvexHull.java
index 19cecdc3..17f40085 100644
--- a/src/main/java/com/thealgorithms/geometry/ConvexHull.java
+++ b/src/main/java/com/thealgorithms/geometry/ConvexHull.java
@@ -1,6 +1,7 @@
 package com.thealgorithms.geometry;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashSet;
@@ -89,7 +90,7 @@ public final class ConvexHull {
         return result;
     }
 
-    private static void constructHull(List<Point> points, Point left, Point right, Set<Point> convexSet) {
+    private static void constructHull(Collection<Point> points, Point left, Point right, Set<Point> convexSet) {
         if (!points.isEmpty()) {
             Point extremePoint = null;
             int extremePointDistance = Integer.MIN_VALUE;
diff --git a/src/main/java/com/thealgorithms/maths/CircularConvolutionFFT.java b/src/main/java/com/thealgorithms/maths/CircularConvolutionFFT.java
index f7010acf..87fc5af5 100644
--- a/src/main/java/com/thealgorithms/maths/CircularConvolutionFFT.java
+++ b/src/main/java/com/thealgorithms/maths/CircularConvolutionFFT.java
@@ -1,6 +1,7 @@
 package com.thealgorithms.maths;
 
 import java.util.ArrayList;
+import java.util.Collection;
 
 /**
  * Class for circular convolution of two discrete signals using the convolution
@@ -19,7 +20,7 @@ public final class CircularConvolutionFFT {
      * @param x The signal to be padded.
      * @param newSize The new size of the signal.
      */
-    private static void padding(ArrayList<FFT.Complex> x, int newSize) {
+    private static void padding(Collection<FFT.Complex> x, int newSize) {
         if (x.size() < newSize) {
             int diff = newSize - x.size();
             for (int i = 0; i < diff; i++) {
diff --git a/src/main/java/com/thealgorithms/maths/ConvolutionFFT.java b/src/main/java/com/thealgorithms/maths/ConvolutionFFT.java
index ce35b02c..ed1ba1bb 100644
--- a/src/main/java/com/thealgorithms/maths/ConvolutionFFT.java
+++ b/src/main/java/com/thealgorithms/maths/ConvolutionFFT.java
@@ -1,6 +1,7 @@
 package com.thealgorithms.maths;
 
 import java.util.ArrayList;
+import java.util.Collection;
 
 /**
  * Class for linear convolution of two discrete signals using the convolution
@@ -19,7 +20,7 @@ public final class ConvolutionFFT {
      * @param x The signal to be padded.
      * @param newSize The new size of the signal.
      */
-    private static void padding(ArrayList<FFT.Complex> x, int newSize) {
+    private static void padding(Collection<FFT.Complex> x, int newSize) {
         if (x.size() < newSize) {
             int diff = newSize - x.size();
             for (int i = 0; i < diff; i++) {
diff --git a/src/main/java/com/thealgorithms/maths/FFT.java b/src/main/java/com/thealgorithms/maths/FFT.java
index 7ca7543d..47605f01 100644
--- a/src/main/java/com/thealgorithms/maths/FFT.java
+++ b/src/main/java/com/thealgorithms/maths/FFT.java
@@ -1,6 +1,7 @@
 package com.thealgorithms.maths;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Collections;
 
 /**
@@ -274,7 +275,7 @@ public final class FFT {
      *
      * @param x The ArrayList to be padded.
      */
-    private static void paddingPowerOfTwo(ArrayList<Complex> x) {
+    private static void paddingPowerOfTwo(Collection<Complex> x) {
         int n = 1;
         int oldSize = x.size();
         while (n < oldSize) {
diff --git a/src/main/java/com/thealgorithms/maths/FFTBluestein.java b/src/main/java/com/thealgorithms/maths/FFTBluestein.java
index 388de6fe..7a03c20c 100644
--- a/src/main/java/com/thealgorithms/maths/FFTBluestein.java
+++ b/src/main/java/com/thealgorithms/maths/FFTBluestein.java
@@ -1,6 +1,7 @@
 package com.thealgorithms.maths;
 
 import java.util.ArrayList;
+import java.util.List;
 
 /**
  * Class for calculating the Fast Fourier Transform (FFT) of a discrete signal
@@ -25,7 +26,7 @@ public final class FFTBluestein {
      * IFFT of signal x.
      * @param inverse True if you want to find the inverse FFT.
      */
-    public static void fftBluestein(ArrayList<FFT.Complex> x, boolean inverse) {
+    public static void fftBluestein(List<FFT.Complex> x, boolean inverse) {
         int n = x.size();
         int bnSize = 2 * n - 1;
         int direction = inverse ? -1 : 1;
diff --git a/src/main/java/com/thealgorithms/maths/Gaussian.java b/src/main/java/com/thealgorithms/maths/Gaussian.java
index 255a84d1..1e025797 100644
--- a/src/main/java/com/thealgorithms/maths/Gaussian.java
+++ b/src/main/java/com/thealgorithms/maths/Gaussian.java
@@ -1,12 +1,13 @@
 package com.thealgorithms.maths;
 
 import java.util.ArrayList;
+import java.util.List;
 
 public final class Gaussian {
     private Gaussian() {
     }
 
-    public static ArrayList<Double> gaussian(int matSize, ArrayList<Double> matrix) {
+    public static ArrayList<Double> gaussian(int matSize, List<Double> matrix) {
         int i;
         int j = 0;
 
diff --git a/src/main/java/com/thealgorithms/maths/NthUglyNumber.java b/src/main/java/com/thealgorithms/maths/NthUglyNumber.java
index 90507701..6484026c 100644
--- a/src/main/java/com/thealgorithms/maths/NthUglyNumber.java
+++ b/src/main/java/com/thealgorithms/maths/NthUglyNumber.java
@@ -2,6 +2,7 @@ package com.thealgorithms.maths;
 
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Map;
 import org.apache.commons.lang3.tuple.MutablePair;
 
 /**
@@ -64,7 +65,7 @@ public class NthUglyNumber {
         }
     }
 
-    private long computeCandidate(final MutablePair<Integer, Integer> entry) {
+    private long computeCandidate(final Map.Entry<Integer, Integer> entry) {
         return entry.getKey() * uglyNumbers.get(entry.getValue());
     }
 
diff --git a/src/main/java/com/thealgorithms/misc/MedianOfMatrix.java b/src/main/java/com/thealgorithms/misc/MedianOfMatrix.java
index d4ddffe8..edeedbbe 100644
--- a/src/main/java/com/thealgorithms/misc/MedianOfMatrix.java
+++ b/src/main/java/com/thealgorithms/misc/MedianOfMatrix.java
@@ -13,7 +13,7 @@ public final class MedianOfMatrix {
     private MedianOfMatrix() {
     }
 
-    public static int median(List<List<Integer>> matrix) {
+    public static int median(Iterable<List<Integer>> matrix) {
         // Flatten the matrix into a 1D list
         List<Integer> linear = new ArrayList<>();
         for (List<Integer> row : matrix) {
diff --git a/src/main/java/com/thealgorithms/misc/PalindromeSinglyLinkedList.java b/src/main/java/com/thealgorithms/misc/PalindromeSinglyLinkedList.java
index 8af8a9b0..51dc099b 100644
--- a/src/main/java/com/thealgorithms/misc/PalindromeSinglyLinkedList.java
+++ b/src/main/java/com/thealgorithms/misc/PalindromeSinglyLinkedList.java
@@ -1,6 +1,5 @@
 package com.thealgorithms.misc;
 
-import com.thealgorithms.datastructures.lists.SinglyLinkedList;
 import java.util.Stack;
 
 /**
@@ -15,8 +14,8 @@ public final class PalindromeSinglyLinkedList {
     private PalindromeSinglyLinkedList() {
     }
 
-    public static boolean isPalindrome(final SinglyLinkedList linkedList) {
-        Stack<Integer> linkedListValues = new Stack<>();
+    public static boolean isPalindrome(final Iterable linkedList) {
+        var linkedListValues = new Stack<>();
 
         for (final var x : linkedList) {
             linkedListValues.push(x);
diff --git a/src/main/java/com/thealgorithms/others/KochSnowflake.java b/src/main/java/com/thealgorithms/others/KochSnowflake.java
index 0e2600a7..46b8edb1 100644
--- a/src/main/java/com/thealgorithms/others/KochSnowflake.java
+++ b/src/main/java/com/thealgorithms/others/KochSnowflake.java
@@ -7,6 +7,7 @@ import java.awt.image.BufferedImage;
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.List;
 import javax.imageio.ImageIO;
 
 /**
@@ -125,7 +126,7 @@ public final class KochSnowflake {
      * applied.
      * @return The transformed vectors after the iteration-step.
      */
-    private static ArrayList<Vector2> iterationStep(ArrayList<Vector2> vectors) {
+    private static ArrayList<Vector2> iterationStep(List<Vector2> vectors) {
         ArrayList<Vector2> newVectors = new ArrayList<Vector2>();
         for (int i = 0; i < vectors.size() - 1; i++) {
             Vector2 startVector = vectors.get(i);
diff --git a/src/main/java/com/thealgorithms/scheduling/PreemptivePriorityScheduling.java b/src/main/java/com/thealgorithms/scheduling/PreemptivePriorityScheduling.java
index 27d85a94..66c99661 100644
--- a/src/main/java/com/thealgorithms/scheduling/PreemptivePriorityScheduling.java
+++ b/src/main/java/com/thealgorithms/scheduling/PreemptivePriorityScheduling.java
@@ -2,6 +2,7 @@ package com.thealgorithms.scheduling;
 
 import com.thealgorithms.devutils.entities.ProcessDetails;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Comparator;
 import java.util.List;
 import java.util.PriorityQueue;
@@ -15,7 +16,7 @@ public class PreemptivePriorityScheduling {
     protected final List<ProcessDetails> processes;
     protected final List<String> ganttChart;
 
-    public PreemptivePriorityScheduling(List<ProcessDetails> processes) {
+    public PreemptivePriorityScheduling(Collection<ProcessDetails> processes) {
         this.processes = new ArrayList<>(processes);
         this.ganttChart = new ArrayList<>();
     }
diff --git a/src/main/java/com/thealgorithms/scheduling/SJFScheduling.java b/src/main/java/com/thealgorithms/scheduling/SJFScheduling.java
index ca2144e4..6d105003 100644
--- a/src/main/java/com/thealgorithms/scheduling/SJFScheduling.java
+++ b/src/main/java/com/thealgorithms/scheduling/SJFScheduling.java
@@ -2,6 +2,7 @@ package com.thealgorithms.scheduling;
 
 import com.thealgorithms.devutils.entities.ProcessDetails;
 import java.util.ArrayList;
+import java.util.List;
 
 /**
  * Implementation of Shortest Job First Algorithm: The algorithm allows the waiting process with the
@@ -87,7 +88,7 @@ public class SJFScheduling {
      * @return returns the process' with the shortest burst time OR NULL if there are no ready
      *     processes
      */
-    private ProcessDetails findShortestJob(ArrayList<ProcessDetails> readyProcesses) {
+    private ProcessDetails findShortestJob(List<ProcessDetails> readyProcesses) {
         if (readyProcesses.isEmpty()) {
             return null;
         }
diff --git a/src/main/java/com/thealgorithms/scheduling/diskscheduling/SSFScheduling.java b/src/main/java/com/thealgorithms/scheduling/diskscheduling/SSFScheduling.java
index 30838821..261c1a38 100644
--- a/src/main/java/com/thealgorithms/scheduling/diskscheduling/SSFScheduling.java
+++ b/src/main/java/com/thealgorithms/scheduling/diskscheduling/SSFScheduling.java
@@ -1,6 +1,7 @@
 package com.thealgorithms.scheduling.diskscheduling;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.List;
 
 /**
@@ -24,7 +25,7 @@ public class SSFScheduling {
         this.currentPosition = currentPosition;
     }
 
-    public List<Integer> execute(List<Integer> requests) {
+    public List<Integer> execute(Collection<Integer> requests) {
         List<Integer> result = new ArrayList<>(requests);
         List<Integer> orderedRequests = new ArrayList<>();
 
diff --git a/src/main/java/com/thealgorithms/sorts/BucketSort.java b/src/main/java/com/thealgorithms/sorts/BucketSort.java
index a6901ac3..62c5e929 100644
--- a/src/main/java/com/thealgorithms/sorts/BucketSort.java
+++ b/src/main/java/com/thealgorithms/sorts/BucketSort.java
@@ -79,7 +79,7 @@ public class BucketSort implements SortAlgorithm {
      * @param <T> the type of elements in the array
      * @return the sorted array
      */
-    private <T extends Comparable<T>> T[] concatenateBuckets(List<List<T>> buckets, T[] array) {
+    private <T extends Comparable<T>> T[] concatenateBuckets(Iterable<List<T>> buckets, T[] array) {
         int index = 0;
         for (List<T> bucket : buckets) {
             Collections.sort(bucket);
diff --git a/src/main/java/com/thealgorithms/sorts/PatienceSort.java b/src/main/java/com/thealgorithms/sorts/PatienceSort.java
index 52ed30d5..0edce8d9 100644
--- a/src/main/java/com/thealgorithms/sorts/PatienceSort.java
+++ b/src/main/java/com/thealgorithms/sorts/PatienceSort.java
@@ -72,7 +72,7 @@ public class PatienceSort implements SortAlgorithm {
      * @param <T> the type of elements in the piles, must be comparable
      * @return a priority queue containing the top element of each pile
      */
-    private static <T extends Comparable<T>> PriorityQueue<PileNode<T>> mergePiles(final List<List<T>> piles) {
+    private static <T extends Comparable<T>> PriorityQueue<PileNode<T>> mergePiles(final Iterable<List<T>> piles) {
         PriorityQueue<PileNode<T>> pq = new PriorityQueue<>();
         for (List<T> pile : piles) {
             pq.add(new PileNode<>(pile.removeLast(), pile));
diff --git a/src/main/java/com/thealgorithms/sorts/PigeonholeSort.java b/src/main/java/com/thealgorithms/sorts/PigeonholeSort.java
index 78d7d81d..19f4291d 100644
--- a/src/main/java/com/thealgorithms/sorts/PigeonholeSort.java
+++ b/src/main/java/com/thealgorithms/sorts/PigeonholeSort.java
@@ -78,7 +78,7 @@ public final class PigeonholeSort {
      * @param array the array to be sorted
      * @param pigeonHoles the populated pigeonholes
      */
-    private static void collectFromPigeonHoles(int[] array, List<List<Integer>> pigeonHoles) {
+    private static void collectFromPigeonHoles(int[] array, Iterable<List<Integer>> pigeonHoles) {
         int index = 0;
         for (final var pigeonHole : pigeonHoles) {
             for (final int element : pigeonHole) {
diff --git a/src/main/java/com/thealgorithms/sorts/TreeSort.java b/src/main/java/com/thealgorithms/sorts/TreeSort.java
index e060af54..6f4e5509 100644
--- a/src/main/java/com/thealgorithms/sorts/TreeSort.java
+++ b/src/main/java/com/thealgorithms/sorts/TreeSort.java
@@ -51,7 +51,7 @@ public class TreeSort implements SortAlgorithm {
         return unsortedArray;
     }
 
-    private <T extends Comparable<T>> List<T> doTreeSortList(List<T> unsortedList) {
+    private <T extends Comparable<T>> List<T> doTreeSortList(Iterable<T> unsortedList) {
         // create a generic BST tree
         BSTRecursiveGeneric<T> tree = new BSTRecursiveGeneric<T>();
 
diff --git a/src/main/java/com/thealgorithms/strings/WordLadder.java b/src/main/java/com/thealgorithms/strings/WordLadder.java
index 084a682b..665e5ff3 100644
--- a/src/main/java/com/thealgorithms/strings/WordLadder.java
+++ b/src/main/java/com/thealgorithms/strings/WordLadder.java
@@ -1,8 +1,8 @@
 package com.thealgorithms.strings;
 
+import java.util.Collection;
 import java.util.HashSet;
 import java.util.LinkedList;
-import java.util.List;
 import java.util.Queue;
 import java.util.Set;
 
@@ -22,7 +22,7 @@ public final class WordLadder {
      * @param wordList a list of words that can be used in the transformation sequence
      * @return the number of words in the shortest transformation sequence, or 0 if no such sequence exists
      */
-    public static int ladderLength(String beginWord, String endWord, List<String> wordList) {
+    public static int ladderLength(String beginWord, String endWord, Collection<String> wordList) {
         Set<String> wordSet = new HashSet<>(wordList);
 
         if (!wordSet.contains(endWord)) {


Test patch:
diff --git a/src/test/java/com/thealgorithms/datastructures/graphs/BoruvkaAlgorithmTest.java b/src/test/java/com/thealgorithms/datastructures/graphs/BoruvkaAlgorithmTest.java
index 8cd0b0a6..f0891699 100644
--- a/src/test/java/com/thealgorithms/datastructures/graphs/BoruvkaAlgorithmTest.java
+++ b/src/test/java/com/thealgorithms/datastructures/graphs/BoruvkaAlgorithmTest.java
@@ -183,7 +183,7 @@ public class BoruvkaAlgorithmTest {
      * @param result list of edges in the Minimum Spanning Tree
      * @return the total weight of the Minimum Spanning Tree
      */
-    int computeTotalWeight(final List<BoruvkaAlgorithm.Edge> result) {
+    int computeTotalWeight(final Iterable<BoruvkaAlgorithm.Edge> result) {
         int totalWeight = 0;
         for (final var edge : result) {
             totalWeight += edge.weight;
diff --git a/src/test/java/com/thealgorithms/datastructures/graphs/EdmondsBlossomAlgorithmTest.java b/src/test/java/com/thealgorithms/datastructures/graphs/EdmondsBlossomAlgorithmTest.java
index 4a723244..aa8e6bee 100644
--- a/src/test/java/com/thealgorithms/datastructures/graphs/EdmondsBlossomAlgorithmTest.java
+++ b/src/test/java/com/thealgorithms/datastructures/graphs/EdmondsBlossomAlgorithmTest.java
@@ -5,6 +5,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Arrays;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 import org.junit.jupiter.api.Test;
@@ -25,7 +26,7 @@ public class EdmondsBlossomAlgorithmTest {
      * @param matching List of matched pairs returned by the algorithm.
      * @return A sorted 2D array of matching pairs.
      */
-    private int[][] convertMatchingToArray(List<int[]> matching) {
+    private int[][] convertMatchingToArray(Collection<int[]> matching) {
         // Convert the list of pairs into an array
         int[][] result = matching.toArray(new int[0][]);
 
diff --git a/src/test/java/com/thealgorithms/misc/WordBoggleTest.java b/src/test/java/com/thealgorithms/misc/WordBoggleTest.java
index 2c79ec79..1d4ed7c5 100644
--- a/src/test/java/com/thealgorithms/misc/WordBoggleTest.java
+++ b/src/test/java/com/thealgorithms/misc/WordBoggleTest.java
@@ -4,6 +4,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import java.util.Arrays;
+import java.util.Collection;
 import java.util.List;
 import java.util.stream.Stream;
 import org.junit.jupiter.api.BeforeEach;
@@ -44,7 +45,7 @@ class WordBoggleTest {
 
     @ParameterizedTest
     @MethodSource("provideSpecialCases")
-    void testBoggleBoardSpecialCases(char[][] specialBoard, String[] words, List<String> expectedWords, String testDescription) {
+    void testBoggleBoardSpecialCases(char[][] specialBoard, String[] words, Collection<String> expectedWords, String testDescription) {
         List<String> result = WordBoggle.boggleBoard(specialBoard, words);
         assertEquals(expectedWords.size(), result.size(), "Test failed for: " + testDescription);
         assertTrue(expectedWords.containsAll(result), "Test failed for: " + testDescription);
diff --git a/src/test/java/com/thealgorithms/scheduling/PreemptivePrioritySchedulingTest.java b/src/test/java/com/thealgorithms/scheduling/PreemptivePrioritySchedulingTest.java
index d0005dda..ea692686 100644
--- a/src/test/java/com/thealgorithms/scheduling/PreemptivePrioritySchedulingTest.java
+++ b/src/test/java/com/thealgorithms/scheduling/PreemptivePrioritySchedulingTest.java
@@ -3,6 +3,7 @@ package com.thealgorithms.scheduling;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 
 import com.thealgorithms.devutils.entities.ProcessDetails;
+import java.util.Collection;
 import java.util.List;
 import java.util.stream.Stream;
 import org.junit.jupiter.params.ParameterizedTest;
@@ -17,7 +18,7 @@ import org.junit.jupiter.params.provider.MethodSource;
 class PreemptivePrioritySchedulingTest {
     @ParameterizedTest
     @MethodSource("provideProcessesAndExpectedSchedules")
-    void testPreemptivePriorityScheduling(List<ProcessDetails> processes, List<String> expectedSchedule) {
+    void testPreemptivePriorityScheduling(Collection<ProcessDetails> processes, List<String> expectedSchedule) {
         PreemptivePriorityScheduling scheduler = new PreemptivePriorityScheduling(processes);
         scheduler.scheduleProcesses();
         assertEquals(expectedSchedule, scheduler.ganttChart);
diff --git a/src/test/java/com/thealgorithms/searches/QuickSelectTest.java b/src/test/java/com/thealgorithms/searches/QuickSelectTest.java
index dd04c85b..cf160b0f 100644
--- a/src/test/java/com/thealgorithms/searches/QuickSelectTest.java
+++ b/src/test/java/com/thealgorithms/searches/QuickSelectTest.java
@@ -4,6 +4,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertThrows;
 
 import java.util.Arrays;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
@@ -225,7 +226,7 @@ class QuickSelectTest {
         return RANDOM.ints(n, ASCII_A, ASCII_Z).mapToObj(i -> (char) i).collect(Collectors.toList());
     }
 
-    private static <T extends Comparable<T>> List<T> getSortedCopyOfList(List<T> list) {
+    private static <T extends Comparable<T>> List<T> getSortedCopyOfList(Collection<T> list) {
         return list.stream().sorted().collect(Collectors.toList());
     }
 }