File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 1+ import java .nio .file .OpenOption ;
12import java .util .ArrayList ;
23import java .util .Comparator ;
34import java .util .List ;
@@ -23,14 +24,14 @@ public int getTotalOfAllGoalsByMidfielders() {
2324 .sum ();
2425 }
2526
26- public Optional <Footballer > getNameOfVfLWolfsburgFootballerWithMostPlayedGames () {
27- Predicate <Footballer > isFromWolfsburg =
28- footballer -> footballer .footballClub ().equals (new FootballClub ("VfL Wolfsburg" , 3 , 1145 ));
29- Comparator <Footballer > sortNumberOfGoalsAscending =
30- (footballer1 , footballer2 ) ->
31- Integer .valueOf (footballer1 .numberOfGames ()).compareTo (footballer2 .numberOfGames ());
27+ public Optional <String > getNameOfVfLWolfsburgFootballerWithMostPlayedGames () {
28+ Predicate <Footballer > isFromWolfsburg = footballer -> footballer .footballClub ()
29+ .equals (new FootballClub ("VfL Wolfsburg" , 3 , 1145 ));
30+ Comparator <Footballer > sortNumberOfGoalsAscending = (footballer1 , footballer2 ) -> Integer
31+ .valueOf (footballer1 .numberOfGames ()).compareTo (footballer2 .numberOfGames ());
3232
33- return footballers .stream ().filter (isFromWolfsburg ).max (sortNumberOfGoalsAscending );
33+ return footballers .stream ().filter (isFromWolfsburg ).max (sortNumberOfGoalsAscending )
34+ .map (footballer -> footballer .name ());
3435 }
3536
3637 public List <FootballClub > getNameOfAllFootballClubs () {
You can’t perform that action at this time.
0 commit comments