ModelConverterUtils { static <T> Iterable<T> extractAuxiliaryData(List<Row> rows, boolean isLabel) { Integer[] order = orderModelRows(rows); return new AuxiliaryDataIterable<T>(rows, order, isLabel); }    }
@Test public void testExtractAuxiliaryData() 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, 3); ModelConverterUtils.appendDataRows(stringList, collector, 3); ModelConverterUtils.appendAuxiliaryData(stringList, collector, 3); Iterable<Object> labels = ModelConverterUtils.extractAuxiliaryData(collector.buffer, true); Iterator<Object> labelIterator = labels.iterator(); Assert.assertTrue(labelIterator.hasNext()); Assert.assertEquals(labelIterator.next(), "apple"); Assert.assertTrue(labelIterator.hasNext()); Assert.assertEquals(labelIterator.next(), "banana"); }