|
1 | 1 | package com.thealgorithms.graph; |
2 | 2 |
|
3 | | -import static org.junit.jupiter.api.Assertions.assertEquals; |
4 | | -import static org.junit.jupiter.api.Assertions.assertFalse; |
5 | | -import static org.junit.jupiter.api.Assertions.assertTrue; |
6 | | - |
7 | | -import java.util.Arrays; |
8 | | -import java.util.Collections; |
9 | | -import java.util.HashMap; |
10 | | -import java.util.LinkedList; |
11 | | -import java.util.List; |
12 | | -import java.util.Map; |
| 3 | +import static org.junit.jupiter.api.Assertions.*; |
| 4 | +import java.util.*; |
13 | 5 | import org.junit.jupiter.api.Test; |
14 | 6 |
|
15 | 7 | public class HierholzerAlgorithmTest { |
16 | 8 |
|
17 | 9 | @Test |
18 | 10 | public void testFindsEulerianCircuitInSimpleTriangleGraph() { |
19 | | - // Create a simple triangle graph where a circuit definitely exists: 0-1, 1-2, 2-0 |
| 11 | + // A simple triangle graph where a circuit definitely exists: 0-1, 1-2, 2-0 |
20 | 12 | Map<Integer, LinkedList<Integer>> graph = new HashMap<>(); |
21 | 13 | graph.put(0, new LinkedList<>(Arrays.asList(1, 2))); |
22 | 14 | graph.put(1, new LinkedList<>(Arrays.asList(0, 2))); |
@@ -50,7 +42,7 @@ public void testFailsForGraphWithOddDegreeVertices() { |
50 | 42 | // The find method should return an empty list |
51 | 43 | assertTrue(algorithm.findEulerianCircuit().isEmpty()); |
52 | 44 | } |
53 | | - |
| 45 | + |
54 | 46 | @Test |
55 | 47 | public void testFailsForDisconnectedGraph() { |
56 | 48 | // Create a graph with two separate triangles (0-1-2 and 3-4-5) |
|
0 commit comments