I'm using Selenide and looking for an opportunity to create children ElementsCollection based on a parent's one. For example, I have a web table and a parent ElementsCollection consisting of table rows. So, after filtering this collection by some condition, I get, for example, 50 result rows. Then need to save the first cell in each row as a SelenideElement in a new ElementsCollection (children). This case doesn't have any issues, if I use List, because I can do this using stream() as:
List<SelenideElement> parents = $$("parent_css_selector");
List<SelenideElement> children = parents.stream().filter(s -> s.getText().equals("some_text")).map(s -> s.$("child_css_locator")).collect(Collectors.toList());
//or even in List<String> if I need to...
List<String> childrenTexts = parents.stream().filter(s -> s.getText().equals("some_text")).map(s -> s.$("child_css_locator")).getText().collect(Collectors.toList());
But since stream() was deprecated in Selenide 6.2.0 I cant find an opportunity to do this.
I've raised this question in specialized Selenide topics in Gitter and GitHub. And I would like to note that I received a response within an hour and it is very valuable approach in project development and support. )) Here is the answer of Andrei Solntsev, Selenide founder.
As far as I understood, he will return non-deprecated stream() in ElementsCollection.