Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MultipolygonTestTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MultipolygonTestTest.java	(revision 15162)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MultipolygonTestTest.java	(revision 15183)
@@ -2,9 +2,15 @@
 package org.openstreetmap.josm.data.validation.tests;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.InputStream;
 import java.util.stream.Collectors;
 
 import org.junit.Rule;
 import org.junit.Test;
+import org.openstreetmap.josm.TestUtils;
 import org.openstreetmap.josm.data.osm.Relation;
+import org.openstreetmap.josm.io.OsmReader;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
@@ -16,6 +22,4 @@
 public class MultipolygonTestTest {
 
-    private static final MultipolygonTest MULTIPOLYGON_TEST = new MultipolygonTest();
-    private static final RelationChecker RELATION_TEST = new RelationChecker();
 
     /**
@@ -24,5 +28,5 @@
     @Rule
     @SuppressFBWarnings(value = "URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD")
-    public JOSMTestRules test = new JOSMTestRules().projection().mapStyles().presets().main();
+    public JOSMTestRules test = new JOSMTestRules().projection().mapStyles().presets().main().preferences();
 
     /**
@@ -32,7 +36,37 @@
     @Test
     public void testMultipolygonFile() throws Exception {
+        final MultipolygonTest MULTIPOLYGON_TEST = new MultipolygonTest();
+        final RelationChecker RELATION_TEST = new RelationChecker();
         ValidatorTestUtils.testSampleFile("data_nodist/multipolygon.osm",
                 ds -> ds.getRelations().stream().filter(Relation::isMultipolygon).collect(Collectors.toList()),
                 name -> name.startsWith("06") || name.startsWith("07") || name.startsWith("08"), MULTIPOLYGON_TEST, RELATION_TEST);
     }
+
+    /**
+     * Non-regression test for ticket #17768.
+     * @throws Exception if an error occurs
+     */
+    @Test
+    public void testTicket17768TouchingInner() throws Exception {
+        try (InputStream is = TestUtils.getRegressionDataStream(17768, "touching-inner.osm")) {
+            MultipolygonTest mpTest = new MultipolygonTest();
+            mpTest.makeFromWays(OsmReader.parseDataSet(is, null).getWays());
+            // inner touches inner, is considered OK in OSM
+            assertTrue(mpTest.getErrors().isEmpty());
+        }
+    }
+
+    /**
+     * Non-regression test for ticket #17768.
+     * @throws Exception if an error occurs
+     */
+    @Test
+    public void testTicket17768TouchingInnerOuter() throws Exception {
+        try (InputStream is = TestUtils.getRegressionDataStream(17768, "touching-inner-outer.osm")) {
+            MultipolygonTest mpTest = new MultipolygonTest();
+            mpTest.makeFromWays(OsmReader.parseDataSet(is, null).getWays());
+            // inner touches outer, should return error
+            assertEquals(1, mpTest.getErrors().size());
+        }
+    }
 }
