How to get first element that matches a criteria in a stream? I\'ve tried this but doesn\'t work
this.stops.stream().filter(Stop s-> s.getStation().getNam
I think this is the best way:
this.stops.stream().filter(s -> Objects.equals(s.getStation().getName(), this.name)).findFirst().orElse(null);