@Test
public void testExtractSortFieldConfigs() throws InvalidMapBoxStyleException, JSONException {

    int count = 5;
    MapBoxStyleHelper helper1 = new MapBoxStyleHelper(new JSONObject());
    for (int i = 0; i < count; i++) {
        SortFieldConfig config1 = new SortFieldConfig(SortFieldConfig.FieldType.DATE,
                "test" + String.valueOf(i));
        helper1.getKujakuConfig().addSortFieldConfig(config1);
    }
    helper1.getKujakuConfig().addDataSourceConfig("test");
    helper1.getKujakuConfig().getInfoWindowConfig().addVisibleProperty("test", "test");
    // Assert size
    SortFieldConfig[] configs1 = SortFieldConfig
            .extractSortFieldConfigs(new MapBoxStyleHelper(helper1.build()));
    Assert.assertEquals(configs1.length, count);
    // Assert order
    for (int i = 0; i < count; i++) {
        Assert.assertEquals(configs1[i].getDataField(), "test" + String.valueOf(i));
    }
}