*/
@Test
public void testSave() throws Exception {
System.out.println("save");;
Randomize filter = new Randomize();
filter.setRandomSeed(455);
FeatureSpecification instance = new FeatureSpecification();
instance.addFilter(filter);
ByteArrayOutputStream out = new ByteArrayOutputStream();
assertTrue(instance.save(out));
out.close();
byte[] bytes = out.toByteArray();
//It wrote something
assertTrue(bytes.length > 0);
//It wrote the correct thing
ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes));
try {
List<Filter> serialized = (List<Filter>) in.readObject();
in.close();
assertEquals(1, serialized.size());
assertTrue(serialized.get(0) instanceof Randomize);
Randomize randomize = (Randomize) serialized.get(0);
assertEquals(filter.getRandomSeed(), randomize.getRandomSeed());
} catch (ClassNotFoundException e) {
assertTrue(e.getMessage(), false);
} catch (IOException e) {
assertTrue(e.getMessage(), false);
}