title: Java Parallel Streams not working properly on Set
body: <p>A little background, Im trying to use Java 8 Parallel Streams to call multiple API's in an asynchronous manner. I would like each API to be called and then block until all API's are returned. I have run into an interesting situation where if I try to stream a map, as opposed to a list, the API's are no longer being called in new threads.</p>
  
  <p>If I run the following code each service is called in a new thread:</p>
  
  <pre><code>    List&lt;GitUser&gt; result1 = Arrays.asList(service1, service2, service3).parallelStream()
          .map(s-&gt;s.getGitUser())
          .collect(Collectors.toList());
  </code></pre>
  
  <p>However, if I used a map to accomplish the same task, each service is called synchronously:</p>
  
  <pre><code>    Map&lt;String, ParallelStreamPOCService&gt; map = new HashMap&lt;&gt;();
      map.put("1", service1);
      map.put("2", service2);
      map.put("3", service3);
  
      List&lt;GitUser&gt; result2 = map.entrySet().parallelStream()
              .map(s-&gt;s.getValue().getGitUser())
              .collect(Collectors.toList());
  </code></pre>
  
  <p>Here is the Service implementation:</p>
  
  <pre><code>    public GitUser getGitUser() {
          LOGGER.info("Loading user " + userName);
          String url = String.format("https://api.github.com/users/%s", userName);
          GitUser results = restTemplate.getForObject(url, GitUser.class);
          try {
              TimeUnit.SECONDS.sleep(secondsToSleep);
          } catch (InterruptedException e) {
              throw new IllegalStateException(e);
          }
          LOGGER.error("Finished " + userName);
          return results;
      }
  </code></pre>