@Test
public void testMultiStringIndexer() throws Exception {

    BatchOperator data = new MemSourceBatchOp(Arrays.asList(rows), new String[]{"f0", "f1"});
    MultiStringIndexer stringIndexer = new MultiStringIndexer()
        .setSelectedCols("f0", "f1")
        .setOutputCols("f0_index", "f1_index")
        .setHandleInvalid("skip")
        .setStringOrderType("frequency_desc");
    data = stringIndexer.fit(data).transform(data);
    Assert.assertEquals(data.getColNames().length, 4);
    List<Row> result = data.collect();
    Assert.assertEquals(result.size(), 4);
    result.forEach(row -> {
        String token1 = (String) row.getField(0);
        Long token2 = (Long) row.getField(1);
        Assert.assertEquals(map1.get(token1), row.getField(2));
        Assert.assertEquals(map2.get(token2), row.getField(3));
    });
}