-
-
Save Jiveloper/f88fded402a661c1e255cffe303c46d6 to your computer and use it in GitHub Desktop.
스트림
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void afterImprovement(List<WebElement> elements) | |
{ | |
elements.stream() | |
.map(WebElement::getText) | |
.distinct() | |
.filter(s -> s.length() > 0) | |
.forEach(System.out::println); | |
} | |
-------------------------------------------------------------------------------- | |
private static void beforeImprovement(List<WebElement> elements) | |
{ | |
Set<String> set = new HashSet<>(); | |
for (WebElement element: elements) | |
{ | |
String category = element.getText(); | |
if (category.length() > 0) | |
{ | |
set.add(category); | |
System.out.println(category); | |
System.out.println(category.getClass().getName()); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment