def METHOD_NAME(self, input_param, input_shape, expected_shape, expected_last_item):
    input_data = np.arange(192).reshape(*input_shape)
    for p in TEST_NDARRAYS_ALL:
        xform = RandSpatialCropSamples(**input_param)
        xform.set_random_state(1234)
        result = xform(p(input_data))
        np.testing.assert_equal(len(result), input_param["num_samples"])
        for i, (item, expected) in enumerate(zip(result, expected_shape)):
            self.assertTupleEqual(item.shape, expected)
            self.assertEqual(item.meta["patch_index"], i)
        assert_allclose(result[-1], expected_last_item, type_test="tensor")