BAEL-2969: Copying Sets in Java

This commit is contained in:
codehunter34 2019-06-07 15:01:42 -04:00
parent 858927c985
commit d69a81e25c
2 changed files with 43 additions and 43 deletions

View File

@ -1,5 +1,4 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>core-java-collections-set</artifactId>

View File

@ -50,7 +50,8 @@ public class CopySets {
// Collectors.toSet
public static <T extends Serializable> Set<T> copyByCollectorsToSet(Set<T> original) {
Set<T> copy = original.stream().collect(Collectors.toSet());
Set<T> copy = original.stream()
.collect(Collectors.toSet());
return copy;
}