Index: trunk/test/data/regress/19822/problem3.geojson
===================================================================
--- trunk/test/data/regress/19822/problem3.geojson	(revision 17185)
+++ trunk/test/data/regress/19822/problem3.geojson	(revision 17185)
@@ -0,0 +1,207 @@
+
+{
+    "type": "FeatureCollection",
+    "generator": "JOSM",
+    "features": [
+        {
+            "type": "Feature",
+            "properties": {
+                "building:part": "yes",
+                "type": "multipolygon",
+                "name": "Part_1"
+            },
+            "geometry": {
+                "type": "MultiPolygon",
+                "coordinates": [
+                    [
+                        [
+                            [
+                                -73.41488671071,
+                                41.53926485597
+                            ],
+                            [
+                                -73.41488823526,
+                                41.53911879136
+                            ],
+                            [
+                                -73.41466310994,
+                                41.53912639890
+                            ],
+                            [
+                                -73.41468140455,
+                                41.53927170274
+                            ],
+                            [
+                                -73.41488671071,
+                                41.53926485597
+                            ]
+                        ],
+                        [
+                            [
+                                -73.41482115503,
+                                41.53919334521
+                            ],
+                            [
+                                -73.41482623687,
+                                41.53921692855
+                            ],
+                            [
+                                -73.41481302409,
+                                41.53923442587
+                            ],
+                            [
+                                -73.41479472948,
+                                41.53923594737
+                            ],
+                            [
+                                -73.41477033667,
+                                41.53923328474
+                            ],
+                            [
+                                -73.41474899296,
+                                41.53922073232
+                            ],
+                            [
+                                -73.41474441931,
+                                41.53919296483
+                            ],
+                            [
+                                -73.41476068119,
+                                41.53917698902
+                            ],
+                            [
+                                -73.41479117220,
+                                41.53917622826
+                            ],
+                            [
+                                -73.41480743407,
+                                41.53918117316
+                            ],
+                            [
+                                -73.41482115503,
+                                41.53919334521
+                            ]
+                        ]
+                    ]
+                ]
+            }
+        },
+        {
+            "type": "Feature",
+            "properties": {
+                "building:part": "yes",
+                "type": "multipolygon",
+                "name": "Part_2"
+            },
+            "geometry": {
+                "type": "MultiPolygon",
+                "coordinates": [
+                    [
+                        [
+                            [
+                                -73.41482115503,
+                                41.53919334521
+                            ],
+                            [
+                                -73.41482623687,
+                                41.53921692855
+                            ],
+                            [
+                                -73.41481302409,
+                                41.53923442587
+                            ],
+                            [
+                                -73.41479472948,
+                                41.53923594737
+                            ],
+                            [
+                                -73.41477033667,
+                                41.53923328474
+                            ],
+                            [
+                                -73.41474899296,
+                                41.53922073232
+                            ],
+                            [
+                                -73.41474441931,
+                                41.53919296483
+                            ],
+                            [
+                                -73.41476068119,
+                                41.53917698902
+                            ],
+                            [
+                                -73.41479117220,
+                                41.53917622826
+                            ],
+                            [
+                                -73.41480743407,
+                                41.53918117316
+                            ],
+                            [
+                                -73.41482115503,
+                                41.53919334521
+                            ]
+                        ],
+                        [
+                            [
+                                -73.41479727040,
+                                41.53920019199
+                            ],
+                            [
+                                -73.41479625404,
+                                41.53921654818
+                            ],
+                            [
+                                -73.41477592669,
+                                41.53921616780
+                            ],
+                            [
+                                -73.41477643488,
+                                41.53919943124
+                            ],
+                            [
+                                -73.41479727040,
+                                41.53920019199
+                            ]
+                        ]
+                    ]
+                ]
+            }
+        },
+        {
+            "type": "Feature",
+            "properties": {
+                "building:part": "yes",
+                "name": "Part_3"
+            },
+            "geometry": {
+                "type": "Polygon",
+                "coordinates": [
+                    [
+                        [
+                            -73.41479727040,
+                            41.53920019199
+                        ],
+                        [
+                            -73.41479625404,
+                            41.53921654818
+                        ],
+                        [
+                            -73.41477592669,
+                            41.53921616780
+                        ],
+                        [
+                            -73.41477643488,
+                            41.53919943124
+                        ],
+                        [
+                            -73.41479727040,
+                            41.53920019199
+                        ]
+                    ]
+                ]
+            }
+        }
+    ]
+}
Index: trunk/test/unit/org/openstreetmap/josm/io/GeoJSONReaderTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/io/GeoJSONReaderTest.java	(revision 17180)
+++ trunk/test/unit/org/openstreetmap/josm/io/GeoJSONReaderTest.java	(revision 17185)
@@ -198,4 +198,19 @@
                     new GeoJSONReader().doParseDataSet(in, null).getPrimitives(it -> true));
             assertTrue(primitives.stream().anyMatch(p -> p instanceof Relation && p.isMultipolygon()));
+            assertEquals(3, primitives.stream().filter(Way.class::isInstance).count());
+        }
+    }
+
+    /**
+     * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/19822">Bug #19822</a>.
+     * @throws Exception in case of error
+     */
+    @Test
+    public void testTicket19822Nested() throws Exception {
+        try (InputStream in = TestUtils.getRegressionDataStream(19822, "problem3.geojson")) {
+            final List<OsmPrimitive> primitives = new ArrayList<>(
+                    new GeoJSONReader().doParseDataSet(in, null).getPrimitives(it -> true));
+            assertTrue(primitives.stream().anyMatch(p -> p instanceof Relation && p.isMultipolygon()));
+            assertEquals(3, primitives.stream().filter(Way.class::isInstance).count());
         }
     }
