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));