class QueryUtil {

    public static JSONObject extractAggregationValue(SearchResponse response)
    {
        JSONObject jsonResp = new JSONObject();
        List<String> name = new ArrayList<>(Arrays.asList("aggregations", "sum#sum", "scripted_metric#agg"));
        try
        {
            jsonResp = new JSONObject(response.toString());
            Iterator keysIterator = jsonResp.keys();
            jsonResp = getJsonObject(jsonResp, name, keysIterator);
        }
        catch (JSONException e)
        {
            LOGGER.error(e.getMessage());
        }
        return jsonResp;
    }

    private  QueryUtil();

}