Preferences prefs = Preferences.userNodeForPackage(BeforeAfterParent.class);
int numMessages = prefs.getInt("numMessages", 0);
prefs.put("message." + numMessages, message);
prefs.putInt("numMessages", ++numMessages);
try {
prefs.sync();
}
catch (BackingStoreException exc) {
throw new TestContainerException(exc);
}
}