style: include OCP_OVERLY_CONCRETE_PARAMETER (#5833)

This commit is contained in:
Piotr Idzik
2024-10-14 22:46:28 +02:00
committed by GitHub
parent 3af4cfd7c8
commit 8886e0996a
28 changed files with 46 additions and 33 deletions

View File

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

View File

@@ -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][]);