private ArrayList<String> getRealmsFromJson(JSONObject jsonChallenges) {
        Iterator<String> challengesIterator = jsonChallenges.keys();
        ArrayList<String> challenges = new ArrayList<>();

        while (challengesIterator.hasNext()) {
            challenges.add(challengesIterator.next());
        }

        return challenges;
    }
private ArrayList < String > getRealmsFromJson ( JSONObject jsonChallenges ) { Iterator < String > challengesIterator = jsonChallenges . keys ( ) ; ArrayList < String > challenges = new ArrayList < > ( ) ; while ( challengesIterator . hasNext ( ) ) { challenges . add ( challengesIterator . next ( ) ) ; } return challenges ; }
Iterates a JSON object containing authorization challenges and builds a list of reals.

@param jsonChallenges Collection of challenges.
@return Array with realms.