code: public Component getComponentOfType(String type) {
          if (type == null || type.trim().length() == 0) {
              throw new IllegalArgumentException("A component type must be provided.");
          }
  
          Optional<Component> component = components.stream().filter(c -> type.equals(c.getType().getType())).findFirst();
          return component.orElse(null);
      }
docs: Gets the component of the specified type.
  
  @param type      the fully qualified type of the component
  @return  the Component instance, or null if a component with the specified type does not exist
  @throws  IllegalArgumentException    if the type is null or empty