diff --git a/core/src/test/java/com/github/weisj/darklaf/icon/AllIconsDemo.java b/core/src/test/java/com/github/weisj/darklaf/icon/AllIconsDemo.java index 30ece345..88a4a6f3 100644 --- a/core/src/test/java/com/github/weisj/darklaf/icon/AllIconsDemo.java +++ b/core/src/test/java/com/github/weisj/darklaf/icon/AllIconsDemo.java @@ -21,10 +21,8 @@ package com.github.weisj.darklaf.icon; import java.awt.*; -import java.util.HashSet; +import java.util.*; import java.util.List; -import java.util.Objects; -import java.util.Properties; import java.util.stream.Collectors; import javax.swing.*; @@ -104,21 +102,21 @@ public class AllIconsDemo extends BaseComponentDemo { return new NamedIcon<>(p, centered ? new CenterIcon(icon, displaySize, displaySize) : icon); }).collect(Collectors.groupingBy(pair -> pathToIconName(pair.getFirst()))) .values().stream() + .map(HashSet::new) .peek(list -> makeUnique(list, 1)) - .flatMap(List::stream) - .sorted(Pair.compareFirst(AllIconsDemo::pathToIconName)).collect(Collectors.toList()); + .flatMap(Set::stream) + .sorted(Pair.compareFirst()).collect(Collectors.toList()); } } - private static void makeUnique(final List> iconList, final int depth) { - if (iconList.size() <= 1) { - iconList.forEach(p -> p.setFirst(pathToIconName(p.getFirst(), depth))); + private static void makeUnique(final Set> iconSet, final int depth) { + if (iconSet.size() <= 1) { + iconSet.forEach(p -> p.setFirst(pathToIconName(p.getFirst(), depth))); } else { - new HashSet<>(iconList) - .stream() + iconSet.stream() .collect(Collectors.groupingBy(p -> pathToIconName(p.getFirst(), depth + 1))) .values() - .forEach(list -> makeUnique(list, depth + 1)); + .forEach(list -> makeUnique(new HashSet<>(list), depth + 1)); } }