code: @SuppressWarnings("ReferenceEquality")
    private boolean hasVisitedType(TemplateType type) {
      for (TemplateType visitedType : visitedTypes) {
        if (visitedType == type) {
          return true;
        }
      }
      return false;
    }
docs: Checks if the specified type has already been visited during the Visitor's
  traversal of a JSType.