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