Example usage for java.util HashSet parallelStream

List of usage examples for java.util HashSet parallelStream

Introduction

In this page you can find the example usage for java.util HashSet parallelStream.

Prototype

default Stream<E> parallelStream() 

Source Link

Document

Returns a possibly parallel Stream with this collection as its source.

Usage

From source file:de.kaiserpfalzEdv.office.contacts.contact.ContactDO.java

@SuppressWarnings("deprecation")
public void setSubContacts(@NotNull final Collection<? extends Contact> contacts) {
    HashSet<ContactDO> contactDOs = new HashSet<>(contacts.size());
    contactDOs.parallelStream().forEach(c -> contactDOs.add((ContactDO) c));

    setSubContacts(contactDOs);//  w w  w  .  jav  a2  s . c om
}