@ Override protected Deque < Step > childValue ( Deque < Step > parentValue ) { Deque < Step > queue = new LinkedList <> ( ) ; queue . add ( parentValue . getFirst ( ) ) ; return queue ; }
In case parent thread spawn thread we need create a new queue for child thread but use the only one root step . In the end all steps will be children of root step all we need is sync adding steps