I have an object:
Trip {
private TripName tripName;
private List<TripStops> tripStops;
}
Trip Stops contains
TripStops {
private PackageObject packageObject;
private PackageTask packageTask;
}
I'm trying to get the count of PackageObject inside trip stop using Java8.
Will I be able to do something like this? Or is there a better way
Integer packageCount = Trip.getTripStops.stream().filter(TripStops::getPackageObject).count