@Test
    public void testSaveAndLoad() {
        DepthOfFieldFilter filter = new DepthOfFieldFilter();

        // Verify the default parameter values:
        verifyDefaults(filter);

        // Set parameters to new values:
        filter.setBlurScale(10.5f);
        filter.setBlurThreshold(0.1f);
        filter.setDebugUnfocus(true);
        filter.setEnabled(false);
        filter.setFocusDistance(66f);
        filter.setFocusRange(15f);

        // Create a duplicate filter using serialization:
        AssetManager assetManager = new DesktopAssetManager();
        DepthOfFieldFilter copy = BinaryExporter.saveAndLoad(assetManager, filter);

        // Verify the parameter values of the copy:
        Assert.assertEquals(10.5f, copy.getBlurScale(), 0f);
        Assert.assertEquals(0.1f, copy.getBlurThreshold(), 0f);
        Assert.assertTrue(copy.getDebugUnfocus());
        Assert.assertEquals(66f, copy.getFocusDistance(), 0f);
        Assert.assertEquals(15f, copy.getFocusRange(), 0f);
        Assert.assertEquals("Depth Of Field", copy.getName());
        Assert.assertFalse(copy.isEnabled());
    }
Tests serialization and de-serialization of a {@code DepthOfFieldFilter}.
This test would've detected JME issue #2166, for instance.
jme3-effects/src/test/java/com/jme3/post/filters/DepthOfFieldFilterTest.java