code: private static List<String> splitToList(String str, String delimiter) {
          ArrayList<String> list = new ArrayList<String>();
          StringTokenizer st = new StringTokenizer(str, delimiter);
          while (st.hasMoreElements()) {
              list.add(st.nextToken());
          }
          return list;
      }
docs: Split a delimiter separated string into an ArrayList
  
  @param str
  the string to split
  @param delimiter
  the character to split on
  @return the list of strings