code: public CodeElement setType(String type) {
          Optional<CodeElement> optional = codeElements.stream().filter(ce -> ce.getRole() == CodeElementRole.Primary).findFirst();
          optional.ifPresent(codeElement -> codeElements.remove(codeElement));
  
          CodeElement codeElement = new CodeElement(type);
          codeElement.setRole(CodeElementRole.Primary);
          this.codeElements.add(codeElement);
  
          return codeElement;
      }
docs: Sets the type of this component (e.g. a fully qualified Java interface/class name).
  
  @param type  the fully qualified type name
  @return  the CodeElement that was created
  @throws IllegalArgumentException if the specified type is null