class JsonUtils {

    public static String getJsonRootProperty(String jsonStr) throws JSONException {
        Iterator<String> iter = getJsonIterator(jsonStr);

        if (!iter.hasNext()) {
            throw new JSONException("Empty JSON object");
        }

        String rootPropertyName = iter.next();

        if (iter.hasNext()) {
            throw new JSONException("JSON object has more than one root property");
        }

        return rootPropertyName;
    }

}