List of usage examples for java.util HashSet parallelStream
default Stream<E> parallelStream()
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 }