I'm converting string array to hashmap using stream.
String[] arguments= new String[]{"-a","1","-b","2","-c","3","-d","4","-e","5"};
HashMap<String, String> params = new HashMap<>();
IntStream.iterate(0, i -> i + 2)
.limit(arguments.length / 2)
.parallel()
.forEach(i -> params.put(arguments[i], arguments[i + 1]));
System.out.println(params.size());
It shows 5, but sometimes 4.
Could you explain, please, what could be the reason of different results?