public static Map<String,String> parseBadges(String data){
  if (data == null || data.isEmpty()) {
    return EMPTY_BADGES;
  }
  LinkedHashMap<String,String> result=new LinkedHashMap<>();
  String[] badges=data.split(",");
  for (  String badge : badges) {
    String[] split=badge.split("/");
    if (split.length == 2) {
      String id=split[0];
      String version=split[1];
      result.put(id,version);
    }
  }
  return Collections.unmodifiableMap(result);
}

public static Map < String , String > parseBadges ( String data ) { if ( data == null || data . isEmpty ( ) ) { return EMPTY_BADGES ; } LinkedHashMap < String , String > result = new LinkedHashMap < > ( ) ; String [ ] badges = data . split ( "," ) ; for ( String badge : badges ) { String [ ] split = badge . split ( "/" ) ; if ( split . length == 2 ) { String id = split [ 0 ] ; String version = split [ 1 ] ; result . put ( id , version ) ; } } return Collections . unmodifiableMap ( result ) ; }
parses the badges tag . the resulting map is unmodifiable .
