We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f73bee2 commit f2f2b48Copy full SHA for f2f2b48
1 file changed
core-java-8/src/main/java/com/baeldung/threadpool/TreeNode.java
@@ -1,9 +1,9 @@
1
package com.baeldung.threadpool;
2
3
-import java.util.Arrays;
4
-import java.util.HashSet;
5
import java.util.Set;
6
+import com.google.common.collect.Sets;
+
7
public class TreeNode {
8
9
int value;
@@ -12,8 +12,7 @@ public class TreeNode {
12
13
public TreeNode(int value, TreeNode... children) {
14
this.value = value;
15
- this.children = new HashSet<>();
16
- this.children.addAll(Arrays.asList(children));
+ this.children = Sets.newHashSet(children);
17
}
18
19
0 commit comments