I'm using Scala 2.11.7 with JDK 1.8 and from the REPL when I'm trying to created mutable and immutable set with 5-6 element, when I was getting result it is automatically giving element in wrong order.
For mutable Set: When I was adding 1 to 6 it gives set as res0: Set(1,5,2,6,3,4) instead of Set(1,2,3,4,5,6)
Same as for immutable Set: When I was adding 1 to 6. it gives res1: Set(5,1,6,2,3,4)
Both mutable and immutable set is working and giving correct order until I add element upto 4. When I add 5th elem it gives returning set in wrong order.
Looks like it is a bug in collection, if not please let me know why it is behaving like this.