@@ -0,0 +1,2971 @@
+/**%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.extra;%0A%0Aimport com.company.sakila.SakilaApplication;%0Aimport com.company.sakila.db0.sakila.film.Film;%0Aimport com.company.sakila.db0.sakila.film.FilmManager;%0Aimport com.speedment.common.tuple.Tuple2;%0Aimport com.speedment.common.tuple.Tuples;%0Aimport com.speedment.example.basic_example.util.ExampleUtil;%0A%0Aimport java.util.List;%0Aimport java.util.Optional;%0Aimport java.util.Set;%0Aimport java.util.stream.Collectors;%0Aimport java.util.stream.IntStream;%0Aimport java.util.stream.Stream;%0A%0Aimport static com.speedment.example.basic_example.util.ExampleUtil.buildApplication;%0Aimport static java.util.stream.Collectors.toList;%0A%0A/**%0A *%0A * @author Per Minborg%0A */%0Apublic class UsersGuide %7B%0A%0A    private final SakilaApplication app;%0A    private final FilmManager films;%0A%0A    public UsersGuide() %7B%0A        app = buildApplication();%0A        films = app.getOrThrow(FilmManager.class);%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        new UsersGuide().run();%0A    %7D%0A%0A    private void run() %7B%0A        distinct();%0A        mapToInt();%0A        mapToTuple();%0A        findId();%0A    %7D%0A%0A    private void distinct() %7B%0A        Set%3CString%3E ratings = films.stream()%0A                .map(Film.RATING)%0A                .distinct()%0A                .collect(Collectors.toSet());%0A%0A        System.out.println(ratings);%0A%0A    %7D%0A%0A    private void mapToInt() %7B%0A        final IntStream ids = films.stream()%0A                .mapToInt(Film.FILM_ID);%0A%0A%0A        ids.forEach(System.out::println);%0A%0A    %7D%0A%0A%0A    private void mapToTuple() %7B%0A        Stream%3CTuple2%3CString, Integer%3E%3E items = films.stream()%0A                .map(Tuples.toTuple(Film.TITLE, Film.LENGTH.getter()));%0A%0A        items.forEach(System.out::println);%0A%0A    %7D%0A%0A    private void findId() %7B%0A        int id = 100;%0A%0A        final Optional%3CString%3E title = films.stream()%0A                .filter(Film.FILM_ID.equal(id))      // find the films we are looking for%0A                .map(Film.TITLE)                     // switch from a stream of films to one of titles%0A                .findAny();                          // we want the first and only match for this unique key%0A%0A        if (title.isPresent()) %7B%0A            System.out.format(%22Film ID %25d has title %25s.%22, id, title.get());%0A        %7D else %7B%0A            System.out.format(%22Film ID not found.%22, id);%0A        %7D%0A    %7D%0A%0A%7D%0A

Add some examples