code: List<JCExpression> typeArguments(boolean diamondAllowed) {
          if (token.kind == LT) {
              nextToken();
              if (token.kind == GT && diamondAllowed) {
                  checkDiamond();
                  mode |= DIAMOND;
                  nextToken();
                  return List.nil();
              } else {
                  ListBuffer<JCExpression> args = new ListBuffer<>();
                  args.append(((mode & EXPR) == 0) ? typeArgument() : parseType());
                  while (token.kind == COMMA) {
                      nextToken();
                      args.append(((mode & EXPR) == 0) ? typeArgument() : parseType());
                  }
                  switch (token.kind) {
  
                  case GTGTGTEQ: case GTGTEQ: case GTEQ:
                  case GTGTGT: case GTGT:
                      token = S.split();
                      break;
                  case GT:
                      nextToken();
                      break;
                  default:
                      args.append(syntaxError(token.pos, "expected", GT));
                      break;
                  }
                  return args.toList();
              }
          } else {
              return List.<JCExpression>of(syntaxError(token.pos, "expected", LT));
          }
      }
docs: {@literal
  TypeArguments  = "<" TypeArgument {"," TypeArgument} ">"
  }