def test_diff_stochastic_series(self):
        """
        Tests that `Diff` class correctly differences and then undifferences a
        random series with multiple samples.
        """
        test_cases = [
            (1, True),
            (1, False),
            ([1, 2, 3, 2, 1], True),
            ([1, 2, 3, 2, 1], False),
        ]

        vals = np.random.rand(10, 5, 10)
        series = TimeSeries.from_values(vals)

        for lags, dropna in test_cases:
            transformer = Diff(lags=lags, dropna=dropna)
            new_series = transformer.fit_transform(series)
            series_back = transformer.inverse_transform(new_series)
            # Should recover original series:
            self.assert_series_equal(series, series_back, equal_nan=(not dropna))

        Tests that `Diff` class correctly differences and then undifferences a
        random series with multiple samples.
        
darts/tests/dataprocessing/transformers/test_diff.py