001/*
002 * Copyright 2023 the original author or authors.
003 * <p>
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 * <p>
008 * https://www.apache.org/licenses/LICENSE-2.0
009 * <p>
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package de.cuioss.test.generator.domain;
017
018import static de.cuioss.tools.collect.CollectionLiterals.immutableList;
019
020import java.util.List;
021
022import de.cuioss.test.generator.internal.net.java.quickcheck.Generator;
023import de.cuioss.tools.collect.CollectionBuilder;
024import lombok.experimental.UtilityClass;
025
026/**
027 * Provides lists of names for creating name {@link Generator}.
028 *
029 * @author Oliver Wolff
030 *
031 */
032@UtilityClass
033@SuppressWarnings("squid:S2386") // owolff: False positive, list are immutable
034public final class NameLibrary {
035
036    // German
037    /** Top 10 male name in Germany 2014 */
038    public static final List<String> FIRSTNAMES_MALE_GERMAN = immutableList("Ben", "Elias", "Fynn", "Jonas", "Leon",
039            "Louis", "Luca", "Lukas", "Noah", "Paul");
040
041    /** Top 10 female name in Germany 2014 */
042    public static final List<String> FIRSTNAMES_FEMALE_GERMAN = immutableList("Anna", "Emilia", "Emma", "Hannah", "Lea",
043            "Lena", "Leonie", "Marie", "Mia", "Sophia");
044
045    /**
046     * The intersection of {@link #FIRSTNAMES_FEMALE_GERMAN} and
047     * {@link #FIRSTNAMES_MALE_GERMAN}.
048     */
049    public static final List<String> FIRSTNAMES_ANY_GERMAN = new CollectionBuilder<String>()
050            .add(FIRSTNAMES_FEMALE_GERMAN).add(FIRSTNAMES_MALE_GERMAN).toImmutableList();
051
052    /** Top 10 names in Wikipedia */
053    public static final List<String> LAST_NAMES_GERMAN = immutableList("Müller", "Schmidt", "Schneider", "Fischer",
054            "Weber", "Meyer", "Wagner", "Becker", "Schulz", "Hoffmann");
055
056    // English
057
058    /** Top 10 male name in Germany 2014 */
059    public static final List<String> FIRSTNAMES_MALE_ENGLISH = immutableList("Jackson", "Aiden", "Liam", "Lucas",
060            "Noah", "Mason", "Ethan", "Caden", "Jacob", "Logan");
061
062    /** Top 10 female name in Germany 2014 */
063    public static final List<String> FIRSTNAMES_FEMALE_ENGLISH = immutableList("Sophia", "Emma", "Olivia", "Ava",
064            "Isabella", "Mia", "Zoe", "Lily", "Emily", "Madelyn");
065
066    /**
067     * The intersection of {@link #FIRSTNAMES_MALE_ENGLISH} and
068     * {@link #FIRSTNAMES_FEMALE_ENGLISH}.
069     */
070    public static final List<String> FIRSTNAMES_ANY_ENGLISH = new CollectionBuilder<String>()
071            .add(FIRSTNAMES_FEMALE_ENGLISH).add(FIRSTNAMES_MALE_ENGLISH).toImmutableList();
072
073    /** Top 10 names from U.S. Census Bureau */
074    public static final List<String> LAST_NAMES_ENGLISH = immutableList("Smith", "Johnson", "Williams", "Brown",
075            "Jones", "Miller", "Davis", "Garcia", "Rodriguez", "Wilson");
076}