code: public static List<Object> parseCSVLine(String line, String separatorChar) {
          String regex = // puts a doublequoted field in group(1) and an unquoted field into group(2)
                  "\\G(?:^|" + separatorChar + ")" +
                  "(?:" +
                  "\"" +
                  "((?:[^\"]++|\"\")*+)" +
                  "\"" +
                  "|" +
                  "([^\"" + separatorChar + "]*)" +
                  ")";
          Matcher mMain = Pattern.compile(regex).matcher("");
          Matcher mQuote = Pattern.compile("\"\"").matcher("");
          Matcher mDouble = Pattern.compile(DOUBLE_REGEX_WITH_NAN).matcher("");
          
          List<Object> values = new ArrayList<>();
          mMain.reset(line);
          while (mMain.find()) {
              Object value;
              if (mMain.start(2) >= 0) {
                  String field = mMain.group(2);
                  if (mDouble.reset(field).matches()) {
                      value = Double.parseDouble(field);
                  } else {
                      value = field;
                  }
              } else {
                  // If quoted, always use string
                  value = mQuote.reset(mMain.group(1)).replaceAll("\"");
              }
              values.add(value);
          }
          return values;
      }
docs: Parses a line of text representing comma separated values and returns
  the values themselves.
  
  @param line the line to parse
  @param separatorChar the regular expression for the separator
  @return the list of values