code: public static String[] parseListRecord(String line) {
          // return null if line is blank
          if (noLength(line)) {
              return null;
          }
  
          // trim away leading / trailing whitespace from list record
          line = line.trim();
  
          // remove list boundaries
          if (line.startsWith("{")) {
              line = line.substring(1);
          }
          if (line.endsWith("}")) {
              line = line.substring(0, line.length() - 1);
          }
  
          // return no fields if list record is empty
          if (line.trim().length() == 0) {
              return new String[0];
          }
  
          // split fields
          final CharacterIterator chit = new StringCharacterIterator(line);
          final List<String> fields = new ArrayList<String>();
          final StringBuilder fb = new StringBuilder();
          boolean inField = false;
          for (char c = chit.first(); c != CharacterIterator.DONE; c = chit
                  .next()) {
              if (!inField && c == FIELD_BOUNDARY) {
                  inField = true;
                  fb.setLength(0);
              } else if (inField && c == FIELD_BOUNDARY) {
                  int mark = chit.getIndex();
                  char previousChar = chit.previous();
                  if (previousChar == ESCAPE) {
                      fb.deleteCharAt(fb.length() - 1);
                      fb.append(c);
                  } else {
                      inField = false;
                  }
                  chit.setIndex(mark);
              } else if (!inField && c == FIELD_SEPARATOR) {
                  fields.add(fb.toString());
              } else if (inField) {
                  fb.append(c);
              }
          }
  
          if (!line.endsWith(",")) {
              fields.add(fb.toString());
          }
  
          return fields.toArray(new String[fields.size()]);
      }
docs: Parse a BELScript list expression into a {@code String[] array}.
  
  @param line the list expression, which should not be {@code null}
  @return the parsed tokens in the list, or {@code null} if {@code line}
  is {@code null}