mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-29 14:19:13 +00:00
feature: added code refactoring changes for 2378 (#2379)
* fix:added code refactoring changes for 2378 * fix:added code refactoring changes for 2378 * build fix for 2378 * fix: updated pom.xml files for 2378 issue * fix:build fix for 2378 issue Co-authored-by: aparna <aparna@aparnas-MacBook-Air.local>
This commit is contained in:
+2
-2
@@ -56,7 +56,7 @@ public class FunctionalProgramming {
|
||||
public static List<String> getModelsAfter2000(List<Car> cars) {
|
||||
return cars.stream().filter(car -> car.getYear() > 2000)
|
||||
.sorted(Comparator.comparing(Car::getYear))
|
||||
.map(Car::getModel).collect(Collectors.toList());
|
||||
.map(Car::getModel).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -78,6 +78,6 @@ public class FunctionalProgramming {
|
||||
public static List<Car> getSedanCarsOwnedSortedByDate(List<Person> persons) {
|
||||
return persons.stream().map(Person::getCars).flatMap(List::stream)
|
||||
.filter(car -> Category.SEDAN.equals(car.getCategory()))
|
||||
.sorted(Comparator.comparing(Car::getYear)).collect(Collectors.toList());
|
||||
.sorted(Comparator.comparing(Car::getYear)).toList();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user