private List<Usericon> parseChatIcons(String json,String stream){
  try {
    JSONParser parser=new JSONParser();
    JSONObject root=(JSONObject)parser.parse(json);
    List<Usericon> iconsNew=new ArrayList<>();
    addUsericon(iconsNew,Usericon.Type.MOD,null,getChatIconUrl(root,"mod","image"));
    addUsericon(iconsNew,Usericon.Type.SUB,stream,getChatIconUrl(root,"subscriber","image"));
    addUsericon(iconsNew,Usericon.Type.TURBO,null,getChatIconUrl(root,"turbo","image"));
    addUsericon(iconsNew,Usericon.Type.BROADCASTER,null,getChatIconUrl(root,"broadcaster","image"));
    addUsericon(iconsNew,Usericon.Type.STAFF,null,getChatIconUrl(root,"staff","image"));
    addUsericon(iconsNew,Usericon.Type.ADMIN,null,getChatIconUrl(root,"admin","image"));
    addUsericon(iconsNew,Usericon.Type.GLOBAL_MOD,null,getChatIconUrl(root,"global_mod","image"));
    return iconsNew;
  }
 catch (  ParseException ex) {
    LOGGER.warning("Error parsing chat icons: " + ex.getLocalizedMessage());
    return null;
  }
}

private List < Usericon > parseChatIcons ( String json , String stream ) { try { JSONParser parser = new JSONParser ( ) ; JSONObject root = ( JSONObject ) parser . parse ( json ) ; List < Usericon > iconsNew = new ArrayList < > ( ) ; addUsericon ( iconsNew , Usericon . Type . MOD , null , getChatIconUrl ( root , "mod" , "image" ) ) ; addUsericon ( iconsNew , Usericon . Type . SUB , stream , getChatIconUrl ( root , "subscriber" , "image" ) ) ; addUsericon ( iconsNew , Usericon . Type . TURBO , null , getChatIconUrl ( root , "turbo" , "image" ) ) ; addUsericon ( iconsNew , Usericon . Type . BROADCASTER , null , getChatIconUrl ( root , "broadcaster" , "image" ) ) ; addUsericon ( iconsNew , Usericon . Type . STAFF , null , getChatIconUrl ( root , "staff" , "image" ) ) ; addUsericon ( iconsNew , Usericon . Type . ADMIN , null , getChatIconUrl ( root , "admin" , "image" ) ) ; addUsericon ( iconsNew , Usericon . Type . GLOBAL_MOD , null , getChatIconUrl ( root , "global_mod" , "image" ) ) ; return iconsNew ; } catch ( ParseException ex ) { LOGGER . warning ( "Error parsing chat icons: " + ex . getLocalizedMessage ( ) ) ; return null ; } }
parses the icons info returned from the twitchapi into a chaticons object containing the urls .
