// when
// QNModel trainedModel = new QNTrainer(5, 500, true).trainModel(new TwoPassDataIndexer(createTrainingStream()));
QNModel trainedModel = new QNTrainer(5, 700, true).trainModel(testDataIndexer);
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;