@@ -0,0 +1,2531 @@
+/**%0A *%0A * Copyright (c) 2006-2018, Speedment, Inc. All Rights Reserved.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22); You may not%0A * use this file except in compliance with the License. You may obtain a copy of%0A * the License at:%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS, WITHOUT%0A * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the%0A * License for the specific language governing permissions and limitations under%0A * the License.%0A */%0Apackage com.speedment.example.basic_example;%0A%0Aimport com.company.sakila.SakilaApplication;%0Aimport com.company.sakila.db0.sakila.actor.Actor;%0Aimport com.company.sakila.db0.sakila.actor.ActorManager;%0Aimport com.company.sakila.db0.sakila.film.Film;%0Aimport com.company.sakila.db0.sakila.film.FilmManager;%0Aimport com.company.sakila.db0.sakila.film_actor.FilmActor;%0Aimport com.company.sakila.db0.sakila.film_actor.FilmActorManager;%0Aimport com.speedment.common.tuple.Tuple3;%0Aimport com.speedment.common.tuple.Tuples;%0Aimport com.speedment.example.basic_example.util.ExampleUtil;%0Aimport com.speedment.runtime.core.ApplicationBuilder;%0Aimport com.speedment.runtime.join.Join;%0Aimport com.speedment.runtime.join.JoinComponent;%0A%0Aimport java.util.Map;%0Aimport java.util.NoSuchElementException;%0Aimport java.util.Optional;%0A%0Aimport static com.speedment.example.basic_example.util.ExampleUtil.buildApplication;%0Aimport static java.util.stream.Collectors.counting;%0Aimport static java.util.stream.Collectors.groupingBy;%0A%0A/**%0A *%0A * @author Per Minborg%0A */%0Apublic class Max %7B%0A%0A    private final SakilaApplication app;%0A    private final FilmManager films;%0A%0A    public Max() %7B%0A        app = buildApplication(b -%3E b.withLogging(ApplicationBuilder.LogType.STREAM));%0A        films = app.getOrThrow(FilmManager.class);%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        new Max().run();%0A    %7D%0A%0A    private void run() %7B%0A        max();%0A        maxViaOrder();%0A    %7D%0A%0A    private void max() %7B%0A        ExampleUtil.log(%22max%22);%0A%0A        Optional%3CFilm%3E longestFilm = films.stream()%0A            .max(Film.LENGTH);%0A%0A        System.out.println(longestFilm);%0A%0A%0A    %7D%0A%0A    private void maxViaOrder() %7B%0A        ExampleUtil.log(%22max%22);%0A%0A        Optional%3CFilm%3E longestFilm = films.stream()%0A            .sorted(Film.LENGTH.reversed())%0A            .limit(1)%0A            .findFirst();%0A%0A%0A        System.out.println(longestFilm);%0A%0A%0A    %7D%0A%0A%0A%0A%7D%0A

Add max() example