Skip to content
This repository was archived by the owner on Feb 10, 2021. It is now read-only.

Commit 0a7dd78

Browse files
committed
Add impl for new method of AccountAnalytics.java
1 parent 56ab37b commit 0a7dd78

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

account-analytics/src/main/java/com.bobocode/AccountAnalytics.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ public List<Account> sortByFirstAndLastNames() {
111111
* @return true if there is an account that has an email with provided domain
112112
*/
113113
public boolean containsAccountWithEmailDomain(String emailDomain) {
114-
throw new UnsupportedOperationException("It's your job to implement this method"); // todo
114+
return accounts.stream()
115+
.map(Account::getEmail)
116+
.anyMatch(email -> email.split("@")[1].equals(emailDomain));
115117
}
116118

117119
/**

0 commit comments

Comments
 (0)