code: 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;
      }
docs: Iterates a JSON object containing authorization challenges and builds a list of reals.
  
  @param jsonChallenges Collection of challenges.
  @return Array with realms.