Skip to content

Commit

Permalink
submit java-collections-ru/streams
Browse files Browse the repository at this point in the history
  • Loading branch information
hexlet-cli committed Feb 1, 2024
1 parent 695983e commit ce8d65a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .current.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"assignment":"java-collections-ru/tests"}
{"assignment":"java-collections-ru/streams"}
38 changes: 19 additions & 19 deletions java-collections-ru/streams/src/main/java/exercise/App.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
package exercise;

import java.util.List;

// BEGIN
class App {
private static final List<String> FREE_DOMAINS = List.of(
"gmail.com",
"yandex.ru",
"hotmail.com"
);
public static long getCountOfFreeEmails(List<String> emails) {
return emails.stream()
.map(email -> email.split("@")[1])
.filter(FREE_DOMAINS::contains)
.count();
}
}
// END
package exercise;

import java.util.List;

// BEGIN
class App {
private static final List<String> FREE_DOMAINS = List.of(
"gmail.com",
"yandex.ru",
"hotmail.com"
);
public static long getCountOfFreeEmails(List<String> emails) {
return emails.stream()
.map(email -> email.split("@")[1])
.filter(FREE_DOMAINS::contains)
.count();
}
}
// END

0 comments on commit ce8d65a

Please sign in to comment.