code: private static List<String> split(String str) {
          List<String> result = new ArrayList<String>();
          int genericCount = 0;
          int startPos = 0;
          for (int i = 0; i < str.length(); i++) {
              if (str.charAt(i) == ',' && genericCount == 0) {
                  result.add(str.substring(startPos, i).trim());
                  startPos = i + 1;
              } else if (str.charAt(i) == '<') {
                  genericCount++;
              } else if (str.charAt(i) == '>') {
                  genericCount--;
              }
          }
          result.add(str.substring(startPos).trim());
          return result;
      }
docs: split by comma, handling nested generified types