code: private static List<String> getGenericTypeParameters(String parameters) {
          List<String> paramList = new ArrayList<String>();
          int balanced = 0;
          StringBuilder current = new StringBuilder();
          for (int i = 0; i < parameters.length(); i++) {
              char c = parameters.charAt(i);
              if (balanced == 0 && c == ',') {
                  paramList.add(current.toString().trim());
                  current = new StringBuilder();
                  continue;
              } else if (c == '<') {
                  balanced++;
              } else if (c == '>') {
                  balanced--;
              }
              current.append(c);
          }
          paramList.add(current.toString());
          return paramList;
      }
docs: parse generic type parameters, making sure nested generics are taken into account