ByteArrayOutputStream modelBytes = new ByteArrayOutputStream();
GenericModelWriter modelWriter = new GenericModelWriter(trainedModel, new DataOutputStream(modelBytes));
modelWriter.persist();
modelWriter.close();
GenericModelReader modelReader = new GenericModelReader(new BinaryFileDataReader(
new ByteArrayInputStream(modelBytes.toByteArray())));
AbstractModel readModel = modelReader.getModel();
QNModel deserModel = (QNModel) readModel;
assertTrue(trainedModel.equals(deserModel));
String[] features2Classify = new String[] {"feature2","feature3", "feature3", "feature3","feature3", "feature3", "feature3","feature3", "feature3", "feature3","feature3", "feature3"};