Index: trunk/test/data/regress/21881/CycleDetector_test_wikipedia.osm
===================================================================
--- trunk/test/data/regress/21881/CycleDetector_test_wikipedia.osm	(revision 19062)
+++ trunk/test/data/regress/21881/CycleDetector_test_wikipedia.osm	(revision 19062)
@@ -0,0 +1,95 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<osm version='0.6' upload='never' generator='JOSM'>
+  <node id='-137726' action='modify' visible='true' lat='47.74161657891' lon='17.37769604149' />
+  <node id='-137727' action='modify' visible='true' lat='47.74160961975' lon='17.37612305842' />
+  <node id='-137728' action='modify' visible='true' lat='47.74043350867' lon='17.37611270985' />
+  <node id='-137731' action='modify' visible='true' lat='47.74043350867' lon='17.37771673864' />
+  <node id='-137732' action='modify' visible='true' lat='47.74071883984' lon='17.37897926452' />
+  <node id='-137733' action='modify' visible='true' lat='47.74045438662' lon='17.38021074469' />
+  <node id='-137734' action='modify' visible='true' lat='47.74011337916' lon='17.37895856738' />
+  <node id='-137735' action='modify' visible='true' lat='47.74163049723' lon='17.38024179041' />
+  <node id='-137736' action='modify' visible='true' lat='47.74119902778' lon='17.38124560197' />
+  <node id='-137737' action='modify' visible='true' lat='47.74161657891' lon='17.38222871639' />
+  <node id='-137738' action='modify' visible='true' lat='47.7420091937' lon='17.38123761625' />
+  <node id='-137746' action='modify' visible='true' lat='47.74044046799' lon='17.38222871639' />
+  <node id='-137759' action='modify' visible='true' lat='47.73993243552' lon='17.38222871639' />
+  <node id='-137760' action='modify' visible='true' lat='47.73994635429' lon='17.38319113367' />
+  <node id='-137761' action='modify' visible='true' lat='47.74046134593' lon='17.38319113367' />
+  <way id='-103300' action='modify' visible='true'>
+    <nd ref='-137726' />
+    <nd ref='-137727' />
+    <tag k='waterway' v='ditch' />
+  </way>
+  <way id='-103301' action='modify' visible='true'>
+    <nd ref='-137727' />
+    <nd ref='-137728' />
+    <tag k='waterway' v='ditch' />
+  </way>
+  <way id='-103302' action='modify' visible='true'>
+    <nd ref='-137728' />
+    <nd ref='-137726' />
+    <tag k='waterway' v='ditch' />
+  </way>
+  <way id='-103305' action='modify' visible='true'>
+    <nd ref='-137731' />
+    <nd ref='-137728' />
+    <tag k='waterway' v='ditch' />
+  </way>
+  <way id='-103306' action='modify' visible='true'>
+    <nd ref='-137731' />
+    <nd ref='-137726' />
+    <tag k='waterway' v='ditch' />
+  </way>
+  <way id='-103307' action='modify' visible='true'>
+    <nd ref='-137733' />
+    <nd ref='-137732' />
+    <nd ref='-137731' />
+    <tag k='waterway' v='ditch' />
+  </way>
+  <way id='-103309' action='modify' visible='true'>
+    <nd ref='-137731' />
+    <nd ref='-137734' />
+    <nd ref='-137733' />
+    <tag k='waterway' v='ditch' />
+  </way>
+  <way id='-103311' action='modify' visible='true'>
+    <nd ref='-137733' />
+    <nd ref='-137735' />
+    <tag k='waterway' v='ditch' />
+  </way>
+  <way id='-103312' action='modify' visible='true'>
+    <nd ref='-137735' />
+    <nd ref='-137726' />
+    <tag k='waterway' v='ditch' />
+  </way>
+  <way id='-103313' action='modify' visible='true'>
+    <nd ref='-137735' />
+    <nd ref='-137736' />
+    <nd ref='-137737' />
+    <tag k='waterway' v='ditch' />
+  </way>
+  <way id='-103315' action='modify' visible='true'>
+    <nd ref='-137737' />
+    <nd ref='-137738' />
+    <nd ref='-137735' />
+    <tag k='waterway' v='ditch' />
+  </way>
+  <way id='-103324' action='modify' visible='true'>
+    <nd ref='-137746' />
+    <nd ref='-137733' />
+    <tag k='waterway' v='ditch' />
+  </way>
+  <way id='-103325' action='modify' visible='true'>
+    <nd ref='-137746' />
+    <nd ref='-137737' />
+    <tag k='waterway' v='ditch' />
+  </way>
+  <way id='-103359' action='modify' visible='true'>
+    <nd ref='-137746' />
+    <nd ref='-137759' />
+    <nd ref='-137760' />
+    <nd ref='-137761' />
+    <nd ref='-137746' />
+    <tag k='waterway' v='ditch' />
+  </way>
+</osm>
Index: trunk/test/data/regress/21881/not_consecutive.osm
===================================================================
--- trunk/test/data/regress/21881/not_consecutive.osm	(revision 19062)
+++ trunk/test/data/regress/21881/not_consecutive.osm	(revision 19062)
@@ -0,0 +1,83 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<osm version='0.6' upload='false' generator='JOSM'>
+  <node id='6780376649' timestamp='2019-09-08T07:06:52Z' uid='10276652' user='Sululu' version='1' changeset='74219981' lat='47.1291095' lon='21.7230971' />
+  <node id='6855025163' timestamp='2019-10-06T10:17:31Z' uid='10276652' user='Sululu' version='1' changeset='75336893' lat='47.1287594' lon='21.7230679' />
+  <node id='6855025164' timestamp='2019-10-06T10:17:31Z' uid='10276652' user='Sululu' version='1' changeset='75336893' lat='47.128815' lon='21.7227853' />
+  <node id='6855025165' timestamp='2019-10-06T10:17:31Z' uid='10276652' user='Sululu' version='1' changeset='75336893' lat='47.1288229' lon='21.7226978' />
+  <node id='6855025166' timestamp='2019-10-06T10:17:31Z' uid='10276652' user='Sululu' version='1' changeset='75336893' lat='47.1288857' lon='21.7224701' />
+  <node id='6855025167' timestamp='2019-10-06T10:17:31Z' uid='10276652' user='Sululu' version='1' changeset='75336893' lat='47.1289508' lon='21.7222705' />
+  <node id='6855025168' timestamp='2019-10-06T10:17:31Z' uid='10276652' user='Sululu' version='1' changeset='75336893' lat='47.1289945' lon='21.722121' />
+  <node id='6855025169' timestamp='2019-10-06T10:17:31Z' uid='10276652' user='Sululu' version='1' changeset='75336893' lat='47.1292171' lon='21.7213232' />
+  <node id='6855025170' timestamp='2019-10-06T10:17:31Z' uid='10276652' user='Sululu' version='1' changeset='75336893' lat='47.1292377' lon='21.7212287' />
+  <node id='6855025171' timestamp='2019-10-06T10:17:31Z' uid='10276652' user='Sululu' version='1' changeset='75336893' lat='47.1290698' lon='21.7218512' />
+  <node id='6855025172' timestamp='2019-10-06T10:17:31Z' uid='10276652' user='Sululu' version='1' changeset='75336893' lat='47.1290536' lon='21.7219092' />
+  <node id='6855025173' timestamp='2019-10-06T10:17:31Z' uid='10276652' user='Sululu' version='1' changeset='75336893' lat='47.1292856' lon='21.7209623' />
+  <node id='6855025174' timestamp='2019-10-06T10:17:31Z' uid='10276652' user='Sululu' version='1' changeset='75336893' lat='47.1293064' lon='21.7208169' />
+  <node id='6855027686' timestamp='2019-10-06T10:17:31Z' uid='10276652' user='Sululu' version='1' changeset='75336893' lat='47.1287994' lon='21.7228646' />
+  <node id='9044997814' timestamp='2021-08-29T10:38:07Z' uid='10276652' user='Sululu' version='1' changeset='110407049' lat='47.1290679' lon='21.7218579' />
+  <node id='9044997815' timestamp='2021-08-29T10:38:07Z' uid='10276652' user='Sululu' version='1' changeset='110407049' lat='47.1290555' lon='21.7219025' />
+  <way id='732065016' timestamp='2019-10-06T10:17:31Z' uid='10276652' user='Sululu' version='1' changeset='75336893'>
+    <nd ref='6855025163' />
+    <nd ref='6855027686' />
+    <nd ref='6855025164' />
+    <tag k='layer' v='-1' />
+    <tag k='tunnel' v='culvert' />
+    <tag k='waterway' v='drain' />
+  </way>
+  <way id='732065017' timestamp='2019-10-06T10:17:31Z' uid='10276652' user='Sululu' version='1' changeset='75336893'>
+    <nd ref='6855025164' />
+    <nd ref='6855025165' />
+    <nd ref='6855025166' />
+    <nd ref='6855025167' />
+    <tag k='waterway' v='drain' />
+  </way>
+  <way id='732065018' timestamp='2019-10-06T10:17:31Z' uid='10276652' user='Sululu' version='1' changeset='75336893'>
+    <nd ref='6855025167' />
+    <nd ref='6855025168' />
+    <tag k='layer' v='-1' />
+    <tag k='tunnel' v='culvert' />
+    <tag k='waterway' v='drain' />
+  </way>
+  <way id='732065019' timestamp='2021-08-29T10:38:07Z' uid='10276652' user='Sululu' version='2' changeset='110407049'>
+    <nd ref='9044997814' />
+    <nd ref='6855025171' />
+    <nd ref='6855025169' />
+    <nd ref='6855025170' />
+    <tag k='waterway' v='drain' />
+  </way>
+  <way id='732065020' timestamp='2021-08-29T10:38:07Z' uid='10276652' user='Sululu' version='2' changeset='110407049'>
+    <nd ref='6855025171' />
+    <nd ref='9044997814' />
+    <nd ref='9044997815' />
+    <nd ref='6855025172' />
+    <tag k='layer' v='-1' />
+    <tag k='tunnel' v='culvert' />
+    <tag k='waterway' v='drain' />
+  </way>
+  <way id='732065021' timestamp='2019-10-06T10:17:31Z' uid='10276652' user='Sululu' version='1' changeset='75336893'>
+    <nd ref='6855025170' />
+    <nd ref='6855025173' />
+    <nd ref='6855025174' />
+    <tag k='waterway' v='drain' />
+  </way>
+  <way id='732065024' timestamp='2019-10-06T10:17:31Z' uid='10276652' user='Sululu' version='1' changeset='75336893'>
+    <nd ref='6780376649' />
+    <nd ref='6855027686' />
+    <tag k='layer' v='-1' />
+    <tag k='tunnel' v='culvert' />
+    <tag k='waterway' v='drain' />
+  </way>
+  <way id='977512672' timestamp='2021-08-29T10:38:07Z' uid='10276652' user='Sululu' version='1' changeset='110407049'>
+    <nd ref='6855025168' />
+    <nd ref='6855025172' />
+    <nd ref='9044997815' />
+    <tag k='waterway' v='drain' />
+  </way>
+  <way id='977512673' timestamp='2021-08-29T10:38:07Z' uid='10276652' user='Sululu' version='1' changeset='110407049'>
+    <nd ref='9044997815' />
+    <nd ref='9044997814' />
+    <tag k='layer' v='-1' />
+    <tag k='tunnel' v='culvert' />
+    <tag k='waterway' v='drain' />
+  </way>
+</osm>
