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

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

        // Set parameters to new values:
        filter.setEnabled(false);
        filter.setGamma(0.7f);
        filter.setNumColors(4);
        filter.setStrength(0.8f);

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

        // Verify the parameter values of the duplicate:
        Assert.assertEquals(0.7f, copy.getGamma(), 0f);
        Assert.assertEquals(4, copy.getNumColors(), 0f);
        Assert.assertEquals(0.8f, copy.getStrength(), 0f);
        Assert.assertFalse(copy.isEnabled());
    }
Tests serialization and de-serialization of a
{@code PosterizationFilter}. This test would've detected JME issue #2167,
for instance.
jme3-effects/src/test/java/com/jme3/post/filters/PosterizationFilterTest.java