It doesn’t make any difference until you use stream.paralle().foreach or foreachordered(). However since you are adding in set the items in the set may not be ordered.
Refer to this link for details to understand difference between these two.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…