Add tests for MRESOLVER-62 (currently inversed)
diff --git a/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/transformer/NearestVersionSelectorTest.java b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/transformer/NearestVersionSelectorTest.java
index b71adab..ab40650 100644
--- a/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/transformer/NearestVersionSelectorTest.java
+++ b/maven-resolver-util/src/test/java/org/eclipse/aether/util/graph/transformer/NearestVersionSelectorTest.java
@@ -8,9 +8,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -82,6 +82,35 @@
         assertEquals( 5, trail.size() );
     }
 
+    // This test must be assertTrue() as soon as MRESOLVER-62 is fixed
+    @Test
+    public void testCycleUnderneathRemovedNode()
+        throws Exception
+    {
+        DependencyNode root = parseResource("cycle-underneath-removed-node.txt" );
+
+        assertSame( root, transform( root ) );
+        List<DependencyNode> trail = find( root, "y" );
+        assertEquals( 6, trail.size() );
+
+        // Node y should have children removed
+        assertFalse( trail.get(0).getChildren().isEmpty() );
+    }
+
+    // This test must be assertFalse() as soon as MRESOLVER-62 is fixed
+    @Test
+    public void testCycleUnderneathRemovedNode2()
+        throws Exception
+    {
+        DependencyNode root = parseResource("cycle-underneath-removed-node2.txt" );
+
+        assertSame( root, transform( root ) );
+
+        // Node x should be present
+        List<DependencyNode> trail = find( root, "x" );
+        assertTrue( trail.isEmpty() );
+    }
+
     @Test
     public void testViolationOfHardConstraintFallsBackToNearestSeenNotFirstSeen()
         throws Exception
diff --git a/maven-resolver-util/src/test/resources/transformer/version-resolver/cycle-underneath-removed-node.txt b/maven-resolver-util/src/test/resources/transformer/version-resolver/cycle-underneath-removed-node.txt
new file mode 100644
index 0000000..5406c72
--- /dev/null
+++ b/maven-resolver-util/src/test/resources/transformer/version-resolver/cycle-underneath-removed-node.txt
@@ -0,0 +1,20 @@
+# This graph has a cycle (x <-> y) underneath a node that is removed from the tree (a:1).
+# However, this cycle also appears as a child of another cycle. Specifically, (q <-> p) depends on d, which depends on x.
+# When conflicts are resolved, the cycle between x and y should be broken.
+(null)
++- gid:a:1
+|  \- gid:x:1                  (x)
+|     \- gid:y:1
+|        \- ^x
++- gid:a:2
++- gid:b:1
+|  +- gid:c:1
+|     \- gid:d:1               (d)
+|        \- ^x
+\- gid:m:1
+   \- gid:n:1
+      +- gid:p:1
+      |  \- gid:q:1
+      \- gid:q:2
+         \- gid:p:2
+            \- ^d
\ No newline at end of file
diff --git a/maven-resolver-util/src/test/resources/transformer/version-resolver/cycle-underneath-removed-node2.txt b/maven-resolver-util/src/test/resources/transformer/version-resolver/cycle-underneath-removed-node2.txt
new file mode 100644
index 0000000..23e4a91
--- /dev/null
+++ b/maven-resolver-util/src/test/resources/transformer/version-resolver/cycle-underneath-removed-node2.txt
@@ -0,0 +1,17 @@
+# This graph has a cycle (x <-> y) underneath a node that is removed from the tree (a:1).
+# However, this cycle also appears as a child of another cycle.
+# Specifically, q:2 depends on x and is part of a cycle (p <-> q).
+# When conflicts are resolved, x should be included.
+(null)
++- gid:a:1
+|  \- gid:x:1                  (x)
+|     \- gid:y:1
+|        \- ^x
++- gid:a:2
+\- gid:m:1
+   \- gid:n:1
+      +- gid:p:1
+      |  \- gid:q:1
+      \- gid:q:2
+         |- gid:p:2
+         \- ^x
\ No newline at end of file