@Test
public void testStatsActionOnlyOnePercentile() throws FoxtrotException {

    StatsRequest request = new StatsRequest();
    request.setTable(TestUtils.TEST_TABLE_NAME);
    request.setField("battery");
    request.setPercentiles(Collections.singletonList(5d));
    BetweenFilter betweenFilter = new BetweenFilter();
    betweenFilter.setFrom(1L);
    betweenFilter.setTo(System.currentTimeMillis());
    betweenFilter.setTemporal(true);
    betweenFilter.setField("_timestamp");
    request.setFilters(Collections.<Filter>singletonList(betweenFilter));
    StatsResponse statsResponse = (StatsResponse)getQueryExecutor().execute(request);
    assertNotNull(statsResponse);
    assertNotNull(statsResponse.getResult());
    assertEquals(1, statsResponse.getResult()
            .getPercentiles()
            .size());
    assertTrue(statsResponse.getResult()
                       .getPercentiles()
                       .containsKey(5d));
}