@startuml
!include style.puml

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":SocketParser" as SocketParser LOGIC_COLOR
participant ":ListCommandParser" as ListCommandParser LOGIC_COLOR
participant ":ListCommandLanguagePredicate" as ListCommandLanguagePredicate LOGIC_COLOR
participant ":ListCommandTagPredicate" as ListCommandTagPredicate LOGIC_COLOR
participant "l:ListCommand" as ListCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant ":Model" as Model MODEL_COLOR
end box

[-> LogicManager : execute("list t/friend")
activate LogicManager

LogicManager -> SocketParser : parseCommand("list t/friend")
activate SocketParser

create ListCommandParser
SocketParser -> ListCommandParser
activate ListCommandParser

ListCommandParser --> SocketParser
deactivate ListCommandParser

SocketParser -> ListCommandParser : parse("t/friend")
activate ListCommandParser

create ListCommandLanguagePredicate
ListCommandParser-> ListCommandLanguagePredicate
activate ListCommandLanguagePredicate

ListCommandLanguagePredicate --> ListCommandParser
deactivate ListCommandLanguagePredicate

ListCommandLanguagePredicate -[hidden]-> ListCommandParser
destroy ListCommandLanguagePredicate

create ListCommandTagPredicate
ListCommandParser-> ListCommandTagPredicate
activate ListCommandTagPredicate

ListCommandTagPredicate --> ListCommandParser
deactivate ListCommandTagPredicate
'Hidden arrow to position the destroy marker below the end of the activation bar.
ListCommandTagPredicate -[hidden]-> ListCommandParser
destroy ListCommandTagPredicate

create ListCommand
ListCommandParser -> ListCommand
activate ListCommand

ListCommand --> ListCommandParser : l
deactivate ListCommand

ListCommandParser --> SocketParser : l
deactivate ListCommandParser
'Hidden arrow to position the destroy marker below the end of the activation bar.
ListCommandParser -[hidden]-> SocketParser
destroy ListCommandParser

SocketParser --> LogicManager : l
deactivate SocketParser

LogicManager -> ListCommand : execute()
activate ListCommand

ListCommand -> Model : updateFilteredPersonList(predicate)
activate Model

Model --> ListCommand
deactivate Model

create CommandResult
ListCommand -> CommandResult
activate CommandResult

CommandResult --> ListCommand
deactivate CommandResult

ListCommand --> LogicManager : result
deactivate ListCommand

[<--LogicManager
deactivate LogicManager
@enduml
