@Test
public void testStatsTrendActionWithMultiLevelNestingSkipPercentile() throws FoxtrotException, JsonProcessingException {

    StatsTrendRequest request = new StatsTrendRequest();
    request.setTable(TestUtils.TEST_TABLE_NAME);
    request.setTimestamp("_timestamp");
    request.setField("battery");
    request.setNesting(Lists.newArrayList("os", "version"));
    request.setFlags(Collections.singleton(AnalyticsRequestFlags.STATS_SKIP_PERCENTILES));
    BetweenFilter betweenFilter = new BetweenFilter();
    betweenFilter.setFrom(1L);
    betweenFilter.setTo(System.currentTimeMillis());
    betweenFilter.setTemporal(true);
    betweenFilter.setField("_timestamp");
    request.setFilters(Collections.<Filter>singletonList(betweenFilter));
    StatsTrendResponse statsTrendResponse = StatsTrendResponse.class.cast(getQueryExecutor().execute(request));
    try {
        System.out.println(Jackson.newObjectMapper()
                                   .writerWithDefaultPrettyPrinter()
                                   .writeValueAsString(statsTrendResponse));
    }
    catch (JsonProcessingException e) {
        e.printStackTrace();
    }
    assertNotNull(statsTrendResponse);
    assertNull(statsTrendResponse.getResult());
    assertNotNull(statsTrendResponse.getBuckets());
    assertEquals(3, statsTrendResponse.getBuckets()
            .size());
    assertEquals(1, statsTrendResponse.getBuckets()
            .get(0)
            .getBuckets()
            .size());
    assertEquals(2, statsTrendResponse.getBuckets()
            .get(1)
            .getBuckets()
            .size());
    assertEquals(1, statsTrendResponse.getBuckets()
            .get(2)
            .getBuckets()
            .size());
    assertNull(statsTrendResponse.getBuckets()
              .get(0)
              .getBuckets()
              .get(0)
              .getResult()
              .get(0)
              .getPercentiles());
}