Skip to content

Commit

Permalink
Replace usage of 'Stream.collect(Collectors.toList())' with 'Stream.t…
Browse files Browse the repository at this point in the history
…oList()'
  • Loading branch information
bonigarcia committed Oct 26, 2023
1 parent be0fdee commit c0c05fe
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/main/java/io/github/bonigarcia/seljup/SeleniumJupiter.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.apache.commons.io.IOUtils;
Expand Down Expand Up @@ -262,10 +261,10 @@ private Object getObjectFromWdm(WebDriverManager wdm, Browser browser,
object = selenideHandler.createSelenideDriver(
(WebDriver) object, parameter, testInstance);
} else if (object != null) {
object = ((List<WebDriver>) object).stream()
.map(driver -> selenideHandler.createSelenideDriver(
driver, parameter, testInstance))
.collect(Collectors.toList());
object = ((List<WebDriver>) object).stream().map(
driver -> selenideHandler.createSelenideDriver(driver,
parameter, testInstance))
.toList();
}
}
return object;
Expand Down Expand Up @@ -638,8 +637,7 @@ public void addBrowsers(String[]... browsers) {

public void addBrowsers(String... browsers) {
browserListList.add(asList(browsers).stream()
.map(browser -> new BrowserBuilder(browser).build())
.collect(Collectors.toList()));
.map(browser -> new BrowserBuilder(browser).build()).toList());
}

public void putBrowserList(String key, List<Browser> browserList) {
Expand Down Expand Up @@ -775,8 +773,7 @@ private void quitWebDriver(ExtensionContext extensionContext) {
if (config.isRecordingWhenFailure()
&& !executionException.isPresent()) {
recordingList = manager.getWebDriverList().stream()
.map(manager::getDockerRecordingPath)
.collect(Collectors.toList());
.map(manager::getDockerRecordingPath).toList();
}

// Quit manager
Expand Down

0 comments on commit c0c05fe

Please sign in to comment.