@Test
public void testExtractModelMetaAndData() throws Exception {

    Params meta = new Params().set(SOME_PARAM, "value");
    List<String> stringList = new ArrayList<>();
    stringList.add("apple");
    stringList.add("banana");
    MockCollector collector = new MockCollector();
    ModelConverterUtils.appendMetaRow(meta, collector, 2);
    ModelConverterUtils.appendDataRows(stringList, collector, 2);
    Tuple2<Params, Iterable<String>> metaAndData = ModelConverterUtils.extractModelMetaAndData(collector.buffer);
    Assert.assertEquals(metaAndData.f0.toJson(), meta.toJson());
    Iterator<String> stringIterator = metaAndData.f1.iterator();
    Assert.assertTrue(stringIterator.hasNext());
    Assert.assertEquals(stringIterator.next(), "apple");
    Assert.assertTrue(stringIterator.hasNext());
    Assert.assertEquals(stringIterator.next(), "banana");
}