@Test
public void testCountWithSorting() throws InvalidArgumentException, QueryBuildException {

    IObject criteria = new DSObject("{ \"filter\": { \"a\": { \"$eq\": \"b\" } }," +
            " \"sort\": [ { \"a\": \"desc\" } ] }");
    PostgresSchema.count(statement, collection, criteria);
    assertEquals("SELECT COUNT(*) FROM test_collection " +
            "WHERE ((((document#>'{a}')=to_json(?)::jsonb)))", body.toString());
    verify(statement, times(1)).pushParameterSetter(any());
}