Java find first element in the collect

Java find first element in the collect
ref‮‬er to:lautturi.com
dataSource.getParkingLots()
                 .stream()
                 .filter(parkingLot -> Objects.equals(parkingLot.getId(), id))
                 .findFirst()
                 .orElse(null);
Created Time:2017-09-30 16:40:58  Author:lautturi