@Test
public void testNoAfterKey() {

    for (String input : Arrays.asList("{"  + bucketsArr + "}", "{" + "}")) {
        JsonObject compositeAggregationJson = gson.fromJson(
                input.replace('\'', '\"'), JsonObject.class);
        CompositeAggregation compositeAggregation = new CompositeAggregation("composite", compositeAggregationJson);
        assertNull(compositeAggregation.getAfterKey());
    }
}