private List<Race> parseRaces(String json){
  List<Race> result=new ArrayList<>();
  if (json == null) {
    return null;
  }
  JSONParser parser=new JSONParser();
  try {
    JSONObject root=(JSONObject)parser.parse(json.trim());
    JSONArray races=(JSONArray)root.get("races");
    for (    Object o : races) {
      if (o instanceof JSONObject) {
        Race race=parseRace((JSONObject)o);
        if (race != null) {
          result.add(race);
        }
      }
    }
  }
 catch (  ParseException|ClassCastException|NullPointerException ex) {
    LOGGER.warning("Error parsing SRL: " + ex);
    return null;
  }
  return result;
}

private List < Race > parseRaces ( String json ) { List < Race > result = new ArrayList < > ( ) ; if ( json == null ) { return null ; } JSONParser parser = new JSONParser ( ) ; try { JSONObject root = ( JSONObject ) parser . parse ( json . trim ( ) ) ; JSONArray races = ( JSONArray ) root . get ( "races" ) ; for ( Object o : races ) { if ( o instanceof JSONObject ) { Race race = parseRace ( ( JSONObject ) o ) ; if ( race != null ) { result . add ( race ) ; } } } } catch ( ParseException | ClassCastException | NullPointerException ex ) { LOGGER . warning ( "Error parsing SRL: " + ex ) ; return null ; } return result ; }
parses the races from the result .
