Posts

Oscar Branch Colquitt

Image
  Nota: Se procura outras definições para Colquitt , veja Colquitt (desambiguação). Oscar Branch Colquitt Oscar Branch Colquitt 25º Governador do Texas Período 17 de janeiro de 1911 19 de janeiro de 1915 Antecessor Thomas Mitchell Campbell Sucessor James E. Ferguson Dados pessoais Nascimento 16 de dezembro de 1861 Camilla, Geórgia Morte 8 de março de 1940 Partido Democrata Profissão Político ...

Will parallel stream work fine with distinct operation?

Image
up vote 7 down vote favorite 1 I was reading about statelessness and came across this in doc: Stream pipeline results may be nondeterministic or incorrect if the behavioral parameters to the stream operations are stateful. A stateful lambda (or other object implementing the appropriate functional interface) is one whose result depends on any state which might change during the execution of the stream pipeline. Now if I have the a list of string ( strList say) and then trying to remove duplicate strings from it using parallel streams in the following way: List<String> resultOne = strList.parallelStream().distinct().collect(Collectors.toList()); or in case we want case insensitive: List<String> result2 = strList.parallelStream().map(String::toLowerCase) .distinct().collec...