private static void saveAndLoad(Savable savable) {
        for (int i = 0; i < exporters.size(); i++) {
            JmeExporter exporter = exporters.get(i);
            JmeImporter importer = importers.get(i);

            // export
            byte[] exportedBytes = null;
            try (ByteArrayOutputStream outStream = new ByteArrayOutputStream()) {
                exporter.save(savable, outStream);
                exportedBytes = outStream.toByteArray();
            } catch (IOException e) {
                Assert.fail(exporter.getClass().getSimpleName() + ": " + e.toString());
            }

            // write the xml into files for debugging.
            // leave this commented out unless you need it since it makes a mess of the jme3-plugins directory.
            /*if (exporter instanceof XMLExporter) {
                try {
                    File outFile = new File(savable.getClass().getSimpleName() + ".xml");
                    outFile.createNewFile();
                    PrintWriter out = new PrintWriter(outFile);
                    out.print(new String(exportedBytes));
                    out.close();
                } catch(IOException ioEx) {

                }
            }*/

            // import
            try (ByteArrayInputStream inStream = new ByteArrayInputStream(exportedBytes)) {
                AssetInfo info = new AssetInfo(null, null) {
                    @Override
                    public InputStream openStream() {
                        return inStream;
                    }
                };
                importer.load(info);    // this is where assertions will fail if loaded data does not match saved data.
            } catch (IOException e) {
                Assert.fail(exporter.getClass().getSimpleName() + ": " + e.toString());
            }
        }
    }
Test suite for implementations of the JmeExporter and JmeImporter interfaces.
There are tests here for all write* and read* methods of the OutputCapsule and InputCapsule interfaces respectively.
jme3-plugins/src/test/java/com/jme3/export/InputOutputCapsuleTest.java